当前位置: 技术问答>linux和unix
请教一个C链接MYSQl的问题,辣手
来源: 互联网 发布时间:2015-06-29
本文导语: 我写了程序,编译时出现下列错误: [tonyzhang@zrtekcomm tonyzhang]$ gcc -o conndb conndb.c -L/usr/lib/mysql -I/usr /include/mysql -lmysqlclient /usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0xbc): In function `my_comp ress_alloc': : undefined referenc...
我写了程序,编译时出现下列错误:
[tonyzhang@zrtekcomm tonyzhang]$ gcc -o conndb conndb.c -L/usr/lib/mysql -I/usr
/include/mysql -lmysqlclient
/usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0xbc): In function `my_comp
ress_alloc':
: undefined reference to `compress'
/usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0x13a): In function `my_unc
ompress':
: undefined reference to `uncompress'
collect2: ld returned 1 exit status
神经中...
[tonyzhang@zrtekcomm tonyzhang]$ gcc -o conndb conndb.c -L/usr/lib/mysql -I/usr
/include/mysql -lmysqlclient
/usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0xbc): In function `my_comp
ress_alloc':
: undefined reference to `compress'
/usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0x13a): In function `my_unc
ompress':
: undefined reference to `uncompress'
collect2: ld returned 1 exit status
神经中...
|
需要最后加个-lz的库编译。