标签:
1.添加mysql的头文件
MYSQLINC = /usr/local/mysql/include
或
MYSQLINC = /usr/local/mysql
2.添加mysql的依赖库
#find / -name "libmysqlclient*" // 查找mysql lib的目录
MYSQLLIB = -L /usr/lib64/mysql -lmysqlclient -lz -lm
3.g++编译时添加 INC 与 MYSQLLIB 的支持
4.如果做了上述步骤仍然提示如下错误:
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [bin/DBServer] Error 1
解决:
ln -s /usr/lib64/mysql/libmysqlclient.so.16 /usr/lib64/libmysqlclient.so
标签:
原文地址:http://www.cnblogs.com/sylar-liang/p/4732335.html