当前位置: 技术问答>linux和unix
mysql program link error
来源: 互联网 发布时间:2015-01-09
本文导语: link error: /usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_compress_alloc': my_compress.o(.text+0xb4): undefined reference to 'compress' /usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_uncompress': my_compress.o(.text+0x12a): un...
link error:
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_compress_alloc':
my_compress.o(.text+0xb4): undefined reference to 'compress'
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_uncompress':
my_compress.o(.text+0x12a): undefined reference to 'uncompress'
who can tell me why?
thanks!
system: RedHat Linux 8.0
mysql: 3.23.53a
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_compress_alloc':
my_compress.o(.text+0xb4): undefined reference to 'compress'
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function 'my_uncompress':
my_compress.o(.text+0x12a): undefined reference to 'uncompress'
who can tell me why?
thanks!
system: RedHat Linux 8.0
mysql: 3.23.53a
|
gcc a.c my_compress.o -o a
将你的目标文件包含进去不就OKla
将你的目标文件包含进去不就OKla
|
just try to link to libmysqlclient.a
gcc a.c -o a -L/usr/lib/mysql -lmysqlclient
gcc a.c -o a -L/usr/lib/mysql -lmysqlclient