tar -zxvf libbson-1.9.5.tar.gz
cd libbson-1.9.5
mkdir cmake-build
cd cmake-build
CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -fPIC -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX="/D/Develop/mongo/libbson" -DCMAKE_C_FLAGS="-D__USE_MINGW_ANSI_STDIO=1" ..
make install
mongo-c-driver安裝
下載對應(yīng)版本的tar.gz文件并解壓
tar -zxvf mongo-c-driver-1.16.2.tar.gz
cd mongo-c-driver-1.16.2
mkdir cmake-build
cd cmake-build
CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -fPIC -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX="/D/Develop/mongo/mongocdriver" -DCMAKE_PREFIX_PATH="/D/Develop/mongo/libbson" -DCMAKE_C_FLAGS="-D__USE_MINGW_ANSI_STDIO=1" ..
make install
mongo-cxx-driver安裝
下載對應(yīng)版本的tar.gz文件并解壓
tar -zxvf r3.4.2.tar.gz
cd mongo-cxx-driver-r3.4.2/build
CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -fPIC -G "MSYS Makefiles" -DBUILD_SHARED_LIBS_WITH_STATIC_MONGOC=ON -DCMAKE_INSTALL_PREFIX="/D/Develop/mongo/mongocxxdriver" -DCMAKE_PREFIX_PATH="D:\Develop\mongo\mongocdriver" -DCMAKE_C_FLAGS="-D__USE_MINGW_ANSI_STDIO=1" ..
make install