下载boost:
https://sourceforge.net/projects/boost/?source=typ_redirect
安装boost:
解压安装
./bootstrap.sh
./b2
./b2 install
在github下载安装mysql-connector-cpp:
git clone https://github.com/mysql/mysql-connector-cpp
cd mysql-connector-cpp/
cmake .
make clean
make
make install
在xcode中进行项目配置
3.项目配置
3.1 Header Search Paths加
/usr/local/include
/usr/local/mysql/include
3.2 Library Search Paths加
/usr/local/lib
/usr/local/mysql/lib
3.1 Other Linker Flags加
-lmysqlcppconn -lm -lmysqlclient -lz
参考:
http://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-distribution.html
http://blog.csdn.net/abcjennifer/article/details/16983929
http://www.cnblogs.com/lchb/articles/3510082.html