#include "mysql/mysql.h"
#include <sys/types.h>
int main(void)
{
MYSQL mysql;
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,"192.168.0.38","root","hello","mysql",0,NULL,0))
{
fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
}
可我编译通不过
[root@192 liul]# gcc -o mysql mysql.c -L/home/liul/mysql4/lib/ -lmysqlclient -I
/home/liul/mysql4/include -lm
/home/liul/mysql4/lib//libmysqlclient.a(my_compress.o): In function `my_uncompre
ss':
my_compress.o(.text+0x9a): undefined reference to `uncompress'
/home/liul/mysql4/lib//libmysqlclient.a(my_compress.o): In function `my_compress
_alloc':
my_compress.o(.text+0x12a): undefined reference to `compress'
collect2: ld returned 1 exit status