Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems compiling mysql c api program

Status
Not open for further replies.

aginamist

Technical User
Apr 3, 2002
1
FI
Hello!

I am currently working on a school project that would need my C program to talk to the database, but I can't seem to get this working. These are the errors I get:

aginamist@shar:~/code/mysql-max-3.23.49a-pc-linux-gnu-i686/include$ gcc test.c -o test -L'/home/aginamist/code/mysql-max-3.23.49a-pc-linux-gnu-i686/lib' -lmysqlclient -lm
/home/aginamist/code/mysql-max-3.23.49a-pc-linux-gnu-i686/lib/libmysqlclient.a(my_compress.o): In function `my_uncompress':
my_compress.o(.text+0xa2): undefined reference to `uncompress'
/home/aginamist/code/mysql-max-3.23.49a-pc-linux-gnu-i686/lib/libmysqlclient.a(my_compress.o): In function `my_compress_alloc':
my_compress.o(.text+0x13a): undefined reference to `compress'
collect2: ld returned 1 exit status

I have included mysql.h
 
Hi,

This is a library problem.

Make sure that mysql libraries are in /usr/local/lib
or some other directories you installed.

Also, check out /etc/ld.so.conf, -L parameter for compiling.
And compile it with g++.

-Kenan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top