编译使用C++ MongoDB Driver
本博客在linux下编译使用C++ MongoDB Driver
准备工作
- GCC 4.8.2+
- CMake 3.2+
- The MongoDB C driver version 1.3.5+
- boost 1.56+
编译安装MongoDB C Driver
The C++ driver uses libbson and the MongoDB C driver internally.
安装c++driver前需要先安装libbson 和 c driver:
$ sudo apt-get install pkg-config libssl-dev libsasl2-dev
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.3.5/mongo-c-driver-1.3.5.tar.gz
$ tar xzf mongo-c-driver-1.3.5.tar.gz
$cd mongo-c-driver-1.3.5/
$ ./configure
如果都配置正确的话机会看到:
libmongoc was configured with the following options:
Build