64位系统下无法连接libmysqlclient.so

64位Linux系统下,源码编译时,有时会无法链接libmysqlclient库:

/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient

请将Makefile里面的
-L/usr/lib/mysql
改为
-L/usr/lib64/mysql 

---------------
或者:
----------------
# cd /usr/lib
# mv lib lib.bak
# ln -s /usr/lib64/mysql /usr/lib/mysql

Leave a Reply

Your email address will not be published. Required fields are marked *