MinGW编译Mongo-CXX-Driver

濮阳宏硕
2023-12-01



8. mongo-cxx-driver

pacman -S mingw-w64-x86_64-cyrus-sasl

pacman -S mingw-w64-x86_64-extra-cmake-modules

export OS_BUILD=64


cd mongo-c-driver-1.14.0/
mkdir cmake-build
cd cmake-build


cmake -G "MSYS Makefiles" -DCMAKE_CXX_FLAGS="-D__USE_MINGW_ANSI_STDIO=1" -DCMAKE_INSTALL_PREFIX=/mingw64/local -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_MONGOC=ON -DENABLE_MAN_PAGES=OFF -DENABLE_HTML_DOCS=OFF ..


vi D:/GISSoft/gdal/mongo-c-driver-1.14.0/src/libbson/src/bson/bson-compat.h

#define __USE_MINGW_ANSI_STDIO 1

make
make install


----------------------------------------------------------------------------------------

cd mongo-cxx-driver-r3.4.0
cd build

export "CPPFLAGS=-I/mingw64/local/include"
export "LDFLAGS=-L/mingw64/local/lib"
export "PKG_CONFIG_PATH=-L/mingw64/local/lib/pkgconfig"


cmake -G "MSYS Makefiles" -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/mingw64/local -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_PREFIX_PATH=/mingw64/local ..

make EP_mnmlstc_core

make

make install

转载于:https://www.cnblogs.com/gispathfinder/p/10691196.html

 类似资料: