自己收集了一些安装时候看的文章
https://www.jianshu.com/p/d77680254418
https://www.jianshu.com/p/c982a2960175
https://blog.51cto.com/juestnow/1950039
https://github.com/mongodb/mongo-cxx-driver
http://mongocxx.org/mongocxx-v3/installation/
http://mongoc.org/libmongoc/1.13.0/tutorial.html#basic-crud-operations
http://mongoc.org/libmongoc/current/installing.html
安装C++驱动之前要安装好C的驱动
安装CXX
git clone https://github.com/mongodb/mongo-cxx-driver.git
cd mongo-cxx-driver
cd build/
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local ..
sudo make EP_mnmlstc_core
sudo make && sudo make install
C的测试
往集合插入hello world
/*
gcc -o insert insert.c -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -I/usr/local/include/libbson-1.0/bson/ -lmongoc-1.0 -lbson-1.0
*/
#include <bson/bson.h>
#include <mongoc/mongoc.h>
#include <stdio.h>
int
main (int argc,
char