On Mon, Dec 13, 2004 at 12:33:51PM -0800, Ibrahim Mubarak wrote:
> g++ tells me things along the line of:
>
> In file included from servercore.h:12,
> from servercore.cpp:1:
> /usr/include/mysql++/mysql++.h:1:22: platform.h: No such file or directory
> /usr/include/mysql++/mysql++.h:3:18: defs.h: No such file or directory
> ...
[snip]
> PACKAGES = clanCore-0.7 clanDisplay-0.7 clanApp-0.7 clanGL-0.7 clanNetwork-0.7
> clanGUI-0.7
> CPPFLAGS = `pkg-config --cflags $(PACKAGES)`
> LIBS = `pkg-config --libs $(PACKAGES)`
> +MYSQLFLAGS = -lmysqlpp -lmysqlclient -I/usr/include/mysql++ -I/usr/include/mysql
> OBJS_SERVER = servercore.o
>
> server: $(OBJS_SERVER)
> - g++ -o server_core $(OBJS_SERVER) $(LIBS)
> + g++ -o server_core $(OBJS_SERVER) $(MYSQLFLAGS) $(LIBS)
It appears that you are using the default implicit rules to compile the
*.cpp files into *.o files. In this case, GNU Make looks for CFLAGS
for C files and CXXFLAGS for C++ files.
I'm not sure how you're managing to use the implicit rules for .cpp files
instead of .cc files, but maybe I've forgotten something about make. :-)
Anyway, the -I/usr/include/mysql++ arguments need to be in these environment
variables when compiling, not just linking. Your makefile snippet only
shows the linking step.
You may also try to put the linker arguments at the end. I seem to vaguely
remember order is important. So the fact you have -l before -I could
be part of your problem as well.
- Chris