List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:December 13 2004 9:29pm
Subject:Re: Compiling a MySQL++ / ClanLib project [mysql++.h's includes not found by g++]
View as plain text  
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

Thread
Compiling a MySQL++ / ClanLib project [mysql++.h's includes not found by g++]Ibrahim Mubarak13 Dec
  • Re: Compiling a MySQL++ / ClanLib project [mysql++.h's includes not found by g++]Chris Frey13 Dec
    • Re: Compiling a MySQL++ / ClanLib project [mysql++.h's includes not found by g++] [SOLVED]Ibrahim Mubarak14 Dec
  • Re: Compiling a MySQL++ / ClanLib project [mysql++.h's includes notfound by g++]Warren Young14 Dec