From: Jonathan Wakely Date: July 4 2007 11:14pm Subject: Re: how to compile and link List-Archive: http://lists.mysql.com/plusplus/6736 Message-Id: <4d11fcd70707041614v3feea8ebw5e2199e5aee228e4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit You haven't linked to mysql++, only to mysqlclient_r. They're different libraries, you need both. On 04/07/07, Albert Sanchez wrote: > 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 >&, > mysqlpp::ColData_Tmpl 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 >