我的mysql是用新立得包管理器安装的, 用C调用mysql函数时,却发现找不到-lmysqlclient,
#find / -name mysqlclient.so 也搜不到,
无意间在/usr/local/lib/mysql下发现了
/usr/local/lib/mysql# ls
libdbug.a libmyisam.a libmysqlclient.a libmysqlclient.so libmysqlclient.so.15.0.0 libmysys.a
libheap.a libmyisammrg.a libmysqlclient.la libmysqlclient.so.15 libmystrings.a libvio.a
在编译时加上路径就可以了,也可以加到标准库里
cp /usr/local/lib/mysql/libmysqlclient.* /usr/lib
如果再找不到:
# apt-cache search libmysql
libmysql++-dev - mysql C++ library bindings (development)
libmysql++2c2a - mysql C++ library bindings (runtime)
libmysql-java - Java database (JDBC) driver for MySQL
libmysql-ocaml - OCaml bindings for MySql
libmysql-ocaml-dev - OCaml bindings for MySql
libmysql-ruby - MySQL module for Ruby
libmysql-ruby1.8 - MySQL module for Ruby 1.8
libmysqlclient15-dev - mysql database development files
libmysqlclient15off - mysql database client library
openoffice.org-base - OpenOffice.org office suite - database
# apt-get install libmysql++-dev
阅读(15637) | 评论(0) | 转发(1) |