How to build MongoDB C driver. There was not much information in Japanese, so I will summarize it.
The MongoDB C driver is not distributed as a binary, so you need to build it from source.
Go to CMake and download ** Windows win64-x64 Installer ** from the download page. After downloading, run the msi package to install.
Go to mongo-c-driver and download the source.
After starting the command prompt, move to the root directory of the source and execute the following command.
set PATH="C:\Program Files\CMake\bin";%PATH%
mkdir cmake-build
cd cmake-build
cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver" "-DCMAKE_PREFIX_PATH=C:\mongo-c-driver" ..
Continue to execute the following command.
set PATH="C:\Program Files (x86)\MSBuild\14.0\Bin";%PATH%
msbuild.exe /p:Configuration=Release ALL_BUILD.vcxproj
msbuild.exe /p:Configuration=Release INSTALL.vcxproj
A lot of warnings are displayed, but if the build is successful, the following binaries will be generated in ** C: \ mongo-c-driver **.
In the above procedure, the build is done with the release configuration, but it is also possible to build with a different build configuration by changing the value specified by ** / p: Configuration = ** to the following value.
value | Description |
---|---|
Debug | Build with debug configuration |
Release | Build with release configuration |
MinSizeRel | Build with minimum size configuration |
RelWithDebInfo | Build with release configuration with debug information |
[^ 1]: This is a debug version of C Runtime Library. It is not installed with the Visual Studio redistributable package.
Recommended Posts