MySQL++
2017-12-17
编译安装mysql++库
- 下载编译
wget https://tangentsoft.com/mysqlpp/releases/mysql++-3.2.3.tar.gz
tar -zxvf mysql++-3.2.3.tar.gz
./configure --prefix=/usr/local --enable-thread-check
make
make install
- 路径添加
/etc/ld.so.conf 添加 /usr/local/lib
/sbin/ldconfig
/bin/ln -s /usr/local/lib/libmysqlpp.so /usr/lib/libmysqlpp.so
程序编译
- 测试
#include <iostream>
#include <mysql++.h>
using namespace mysqlpp;
using namespace std;
int main() {
Connection conn(false);
conn.connect("database", "host", "user", "password", port);
Query query = conn.query("select * from table1");
}
- 编译
-lmysqlpp