Linking C++ app with mysqlclient
Hi,
I'm trying to compile and link a C++ app with mysqlclient (on Solaris), but I keep getting errors from the linker.
I downloaded mysql-standard-4.0.20-sun-solaris2.9-sparc-64bit and extracted the include and lib dirs to ../include and ../lib
ls -l ../lib/
-rw------- 1 ovdspek 32080 May 14 03:35 libdbug.a
-rw------- 1 ovdspek 796192 May 14 03:33 libmysqlclient.a
-rw------- 1 ovdspek 821840 May 14 03:27 libmysqlclient_r.a
-rw------- 1 ovdspek 8539398 Sep 5 02:01 libmysqld.a
ls -l
-rw-r--r-- 1 ovdspek 100 Sep 5 21:02 mysql_test.cpp
cat mysql_test.cpp
#include <mysql/mysql.h>
int main()
{
MYSQL h;
mysql_init(&h);
return 0;
}
g++ -I ../include -L ../lib -lmysqlclient mysql_test.cpp
Undefined first referenced
symbol in file
mysql_init /var/tmp/cc1qe2dk.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
I think it's a simple problem, but I can't find the solution.
Could anybody help me?
Subject
Written By
Posted
Linking C++ app with mysqlclient
September 05, 2004 01:08PM
September 06, 2004 09:22PM
September 07, 2004 10:31AM
September 07, 2004 12:00PM
September 07, 2004 12:27PM
September 08, 2004 09:51PM
September 09, 2004 02:25AM
September 09, 2004 03:36AM
September 09, 2004 12:51PM
September 10, 2004 06:23AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.