Hi there,  guys.
I'm new to MySQL++.

When I try to compile the first simple example of mysql++ tutorial, the following error occurs:
--------------------------------


g++ -g -O -Wall -I/usr/include/mysql++ -I/usr/include/mysql -c sqltest.cc

In file included from sqltest.cc:3:

/usr/include/mysql++/sqlplus.hh:1:2: warning: #warning This header is 
obsolete.Please use mysql++.h instead.

g++ -o sqltest sqltest.o -L/usr/lib/mysql -R/usr/lib/mysql -lmysqlclient -lm -lz

g++: unrecognized option `-R/usr/lib/mysql'

sqltest.o(.text+0x41): In function `main':

/home/arthur/sqltest.cc:8: undefined reference to 
`mysqlpp::Connection::Connection(char const*, char const*, char const*, char 
const*, bool)'

sqltest.o(.text+0x59):/home/arthur/sqltest.cc:16: undefined reference to 
`mysqlpp::Connection::query()'

sqltest.o(.text+0x8e): In function `main':

/usr/include/mysql++/query.h:90: undefined reference to 
`mysqlpp::Query::store(mysqlpp::SQLQueryParms&)'

sqltest.o(.text+0xa7):/usr/include/mysql++/query.h:82: undefined reference to 
`mysqlpp::SQLQuery::str(mysqlpp::SQLQueryParms&)'

sqltest.o(.text+0x1a1): In function `main':

/usr/include/mysql++/row.h:244: undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.text+0x1ab):/usr/include/mysql++/row.h:244: undefined reference to 
`vtable for mysqlpp::Row'

sqltest.o(.text+0x2c4):/usr/include/mysql++/row.h:276: undefined reference to 
`vtable for mysqlpp::Row'

sqltest.o(.text+0x2ce):/usr/include/mysql++/row.h:276: undefined reference to 
`vtable for mysqlpp::Row'

sqltest.o(.text+0x4db): In function `main':

/usr/include/mysql++/result.h:159: undefined reference to 
`mysqlpp::ResUse::~ResUse()'

sqltest.o(.text+0x8ee): In function `main':

/usr/include/mysql++/row.h:276: undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.text+0x8f8):/usr/include/mysql++/row.h:276: undefined reference to 
`vtable for mysqlpp::Row'

sqltest.o(.text+0xb15): In function `main':

/usr/include/mysql++/result.h:159: undefined reference to 
`mysqlpp::ResUse::~ResUse()'

sqltest.o(.text+0xf38): In function `main':

/home/arthur/sqltest.cc:16: undefined reference to 
`mysqlpp::Connection::~Connection()'

sqltest.o(.text+0xf4e):/home/arthur/sqltest.cc:16: undefined reference to 
`mysqlpp::Connection::~Connection()'

sqltest.o(.gnu.linkonce.t._ZN7mysqlpp6ResultD1Ev+0x16): In function 
`mysqlpp::Result::~Result()':

/usr/include/mysql++/result.h:159: undefined reference to 
`mysqlpp::ResUse::~ResUse()'

sqltest.o(.gnu.linkonce.t._ZN7mysqlpp6ResultD0Ev+0x19): In function 
`mysqlpp::Result::~Result()':

/usr/include/mysql++/result.h:159: undefined reference to 
`mysqlpp::ResUse::~ResUse()'

sqltest.o(.gnu.linkonce.t._ZNK7mysqlpp6Result9fetch_rowEv+0xcd): In function 
`mysqlpp::Result::fetch_row() const':

/usr/include/mysql++/row.h:244: undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.gnu.linkonce.t._ZNK7mysqlpp6Result9fetch_rowEv+0xd4):/usr/include/mysql++/row.h:244:
 undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1EPPcPKNS_6ResUseEPjb+0x1a): In 
function `mysqlpp::Row::Row(char**, mysqlpp::ResUse const*, unsigned int*, 
bool)':

/usr/include/mysql++/row.h:247: undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1EPPcPKNS_6ResUseEPjb+0x21):/usr/include/mysql++/row.h:247:
 undefined reference to `vtable for mysqlpp::Row'

sqltest.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1EPPcPKNS_6ResUseEPjb+0x3aa):/usr/include/mysql++/row.h:253:
 undefined reference to `mysqlpp::Row::size() const'

collect2: ld returned 1 exit status

make: ** [sqltest] Erro 1

[EMAIL PROTECTED] ~ $

----------------------------
I've read on the FAQ that I need to link the libmysqlclient, but I don't know how to do it.


Thank you.

Arthur Maciel

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to