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