  | | | how to compile and link | how to compile and link 2007-07-04 - By Albert Sanchez
Back Hello,
I'm new to MySQL++
I've just installed mysql++-2.3.0 in an Ubuntu Linux following the instructions in README.linux
I want to compile an example but I must be missing something... it doesn't work:
I have tried thinks like
g++ -I/LWGW/mysql/lib -I/usr/include/mysql/ -L /usr/lib/mysql -lmysqlclient_r simple1.cpp
And the answer is:
/tmp/cc4wpKdP.o: In function `main': simple1.cpp:(.text+0xaf): undefined reference to `mysqlpp::Connection::Connectio n(bool)' simple1.cpp:(.text+0xd5): undefined reference to `connect_to_db(int, char**, mys qlpp::Connection&, char const*)' simple1.cpp:(.text+0x103): undefined reference to `mysqlpp::Connection::query()'
simple1.cpp:(.text+0x1ae): undefined reference to `mysqlpp::Row::at(unsigned int ) const' simple1.cpp:(.text+0x1d9): undefined reference to `mysqlpp::operator<<(std::basi c_ostream<char, std::char_traits<char> >&, mysqlpp::ColData_Tmpl<mysqlpp::const_ string> const&)' simple1.cpp:(.text+0x27e): undefined reference to `mysqlpp::Row::~Row()' simple1.cpp:(.text+0x29a): undefined reference to `mysqlpp::Row::~Row()' simple1.cpp:(.text+0x2bd): undefined reference to `mysqlpp::Row::~Row()' simple1.cpp:(.text+0x2d9): undefined reference to `mysqlpp::Row::~Row()' simple1.cpp:(.text+0x30b): undefined reference to `mysqlpp::Query::error()' simple1.cpp:(.text+0x400): undefined reference to `mysqlpp::Connection::~Connect ion()' simple1.cpp:(.text+0x422): undefined reference to `mysqlpp::Connection::~Connect ion()'
etc...
Can you help me please?
Thanks in advance
Albert
|
|
 |