Like this?:
> g++ \
> -I./lib/MySQLPP -I./lib/TCLAP -I./lib/Miscellaneous \
> ./src/Main.cpp -o ./bin/AWIWorldServer;
> -lmysqlpp -lpthread -lnsl -lresolv \
> `mysql_config --cflags` `mysql_config --libs`
>
Thanks.
2008/7/24 Warren Young <mysqlpp@stripped>
> Alex wrote:
>
>> g++ \
>>> -I./lib/MySQLPP -I./lib/TCLAP -I./lib/Miscellaneous \
>>> `mysql_config --cflags` `mysql_config --libs` `mysql_config --libs_r` \
>>> -lmysqlpp -lpthread -lnsl -lresolv \
>>> ./src/Main.cpp -o ./bin/AWIWorldServer;
>>>
>>
> Move the -l flags and mysql_config commands to the end of the command line.
> POSIX linkers look at the command line right-to-left: the rightmost object
> should depend on nothing else, the next to rightmost should depend on either
> nothing, or only on what is in the rightmost object, etc. The leftmost
> objects should be those that depend on everything to the right. Since
> there's nothing to the right of your program modules, the linker doesn't see
> anything it can link AWIWorldServer to. (Except for default libraries like
> libc, that is, which is always to the right of everything else.)
>
> Your library order is otherwise correct: least generic on the left, most
> generic on the right.
>
> Also, you should only be giving one of --libs or --libs_r to mysql_config.
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>
--
GamerzWoW - http://www.gamerzwow.net
| Thread |
|---|
| • "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 24 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*,char const*, char const*, char const*, unsigned int)'" | Warren Young | 24 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 25 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 26 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 26 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 27 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 27 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 27 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 28 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 28 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 28 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 28 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*,char const*, char const*, char const*, unsigned int)'" | Warren Young | 28 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 29 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 29 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 29 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Warren Young | 29 Jul |
| • Re: "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" | Alex | 29 Jul |