I am trying to compile a custom program I wrote some c++ wrapper classes
around the mysql c function.  I have the mysqlclient_r lib installed in
/usr/local/lib/

ls -l /usr/local/lib/libmysqlclient_r.a
rw-r--r--    1 root     root       287356 May 22 13:28
/usr/local/lib/libmysqlclient_r.a

The files compile fine but when make tries to link them all together I get a
bunch of undefined reference.  I am using MYSQL 3.23.49.

g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)

Anyone have an idea what I am doing wrong?  Below is the output from make.

TIA
Jason

make[1]: Entering directory `/home/jason/ias'
### Making Linux_server
make "CC=g++" "CFLAGS=-O -g -I/home/jason/mysql/include "
"CPPFLAGS=-O -g -I/home/jason/mysql/include "
"LIBS=-L/usr/local/lib/ -lm -lmysqlclient_r -lz -lnsl -lrt -lpthread "
realTime
make[2]: Entering directory `/home/jason/ias'
g++ -O -g -I/home/jason/mysql/include  -L/usr/local/lib/ -lm -lmysqlclient_r
 -lz -lnsl -lrt -lpthread -L/usr/local/lib/ -o realTime main.o Timer.o ...
UserEvent.o IASConnection.o Date.o SendStateMessage.o
MySQLStatement.o: In function `MySQLStatement::query(char const *, int)':
/home/jason/ias/MySQLStatement.cpp:14: undefined reference to
`mysql_real_query'
MySQLStatement.o: In function `MySQLStatement::getResults(void)':
/home/jason/ias/MySQLStatement.cpp:18: undefined reference to
`mysql_store_result'
/home/jason/ias/MySQLStatement.cpp:20: undefined reference to
`MySQLResultSet::MySQLResultSet(st_mysql_res *)'
MySQLStatement.o: In function `MySQLStatement::numRowsAffect(void)':
/home/jason/ias/MySQLStatement.cpp:24: undefined reference to
`mysql_affected_rows'
MySQLConnection.o: In function `Connection type_info function':
/home/jason/ias/MySQLDatabase.h(.text+0x14): undefined reference to
`mysql_init'
MySQLConnection.o: In function `MySQLConnection::connect(char const *, char
const *, char const *, char const *, unsigned int, char const *, unsigned
int)':
/home/jason/ias/MySQLConnection.cpp:8: undefined reference to
`mysql_real_connect'
MySQLConnection.o: In function `MySQLConnection::isConnected(void)':
/home/jason/ias/MySQLConnection.cpp:12: undefined reference to `mysql_ping'
MySQLConnection.o: In function `MySQLConnection::getError(void)':
/usr/include/g++-3/std/bastring.h:183: undefined reference to `mysql_error'
MySQLConnection.o: In function `MySQLConnection::getErrorCode(void)':
/home/jason/ias/MySQLConnection.cpp:21: undefined reference to `mysql_errno'
MySQLConnection.o: In function `MySQLConnection::close(void)':
/home/jason/ias/MySQLConnection.cpp:25: undefined reference to `mysql_close'
MySQLConnection.o: In function `MySQLConnection::getConnectionInfo(void)':
/usr/include/g++-3/std/bastring.h:183: undefined reference to
`mysql_get_host_info'
MySQLPreparedStatement.o: In function `MySQLPreparedStatement::query(char
const *, int)':
/home/jason/ias/MySQLPreparedStatement.cpp:148: undefined reference to
`mysql_real_query'
MySQLPreparedStatement.o: In function
`MySQLPreparedStatement::getResults(void)':
/home/jason/ias/MySQLPreparedStatement.cpp:152: undefined reference to
`mysql_store_result'
/home/jason/ias/MySQLPreparedStatement.cpp:154: undefined reference to
`MySQLResultSet::MySQLResultSet(st_mysql_res *)'
MySQLPreparedStatement.o: In function
`MySQLPreparedStatement::numRowsAffect(void)':
/home/jason/ias/MySQLPreparedStatement.cpp:158: undefined reference to
`mysql_affected_rows'
MySQLPreparedStatement.o: In function
`MySQLPreparedStatement::encodeString(char const *, unsigned long)':
/home/jason/ias/MySQLPreparedStatement.cpp:163: undefined reference to
`mysql_real_escape_string'
collect2: ld returned 1 exit status
make[2]: *** [realTime] Error 1
make[2]: Leaving directory `/home/jason/ias'
make[1]: *** [Linux_server] Error 2
make[1]: Leaving directory `/home/jason/ias'
make: *** [all] Error 2



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to