[RESOLVED]Link error with GCC
Posted by: Sonique Cédric
Date: January 06, 2006 03:42AM

Hi, Happy New Year !
I want compile an example program using MySQL API C. I try on Mac OS X, Debian Testing and Mandrake 10.2 but evrytime the same link error :
I try on GCC 4.0 and 3.3, on MySQL 5.0 and 4.1.
mysql.h is there.

i have try with 2 compilations lines, but evrytime same error... i don't understand !

gcc -o xmy mysqldemo.c `mysql_config --cflags --libs`
gcc -o xmy mysqldemo.c -I/usr/local/mysql/include -L/usr/local/mysql/lib -lmysqlclient
/usr/bin/ld: Undefined symbols:
_compress
_uncompress
collect2: ld returned 1 exit status

Thanks for help !
Sonique

source code : http://www.synnottsoftware.com/tutorials/mysqlbasic.php
-----
Don't use mysql_connect, use mysql_real_connect. it's writed on mysql.com

for compress / uncompress it's only on mac os X but with -lz option that work ! like that :
gcc -o xmy mysql_test.c -I/usr/local/mysql/include -L/usr/local/mysql/lib -lmysqlclient -lz

Options: ReplyQuote


Subject
Views
Written By
Posted
[RESOLVED]Link error with GCC
930
January 06, 2006 03:42AM


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.