How to build MongoDB C driver

Overview

How to build MongoDB C driver. There was not much information in Japanese, so I will summarize it.

Prerequisites

How to build

The MongoDB C driver is not distributed as a binary, so you need to build it from source.

1. Install CMake

Go to CMake and download ** Windows win64-x64 Installer ** from the download page. After downloading, run the msi package to install.

2. Download mongo-c-driver

Go to mongo-c-driver and download the source.

3. Build with CMake

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" ..

4. Build with MSBuild

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 **.

About build configuration

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

error.png

[^ 1]: This is a debug version of C Runtime Library. It is not installed with the Visual Studio redistributable package.

Recommended Posts

How to build MongoDB C driver
How to wrap C in Python
How to build my own Linux server
How to build a sphinx translation environment
How to build Hello, World on #Nix
How to use Google Test in C
How to use JDBC driver with Redash
How to use the C library in Python
How to make an embedded Linux device driver (11)
How to make an embedded Linux device driver (1)
How to generate permutations in Python and C ++
How to make an embedded Linux device driver (4)
[Latest] How to build Java environment on Ubuntu
How to set Django DB to mongodb visual studio 2019
How to make an embedded Linux device driver (7)
How to multi-process exclusive control in C language
How to make an embedded Linux device driver (3)
How to make an embedded Linux device driver (6)
How to build Java environment on Ubuntu (Linux)
How to make an embedded Linux device driver (5)
[TF] How to build Tensorflow in Proxy environment
How to make an embedded Linux device driver (10)
[PyTorch] Sample ⑧ ~ How to build a complex model ~
How to make an embedded Linux device driver (9)
How to force build TensorFlow 2.3.0 for CUDA11 + cuDNN8
How to use xml.etree.ElementTree
How to build two CentOS7 environments / Windows10 + VirtualBox + Vagrant
How to use virtualenv
Scraping 2 How to scrape
How to use Seaboan
How to use image-match
How to use shogun
How to install Python
How to use Pandas 2
How to read PyPI
How to install pip
How to use Virtualenv
How to use numpy.vectorize
How to update easy_install
How to install archlinux
How to use pytest_report_header
How to restart gunicorn
Access MongoDB in C
How to install python
How to virtual host
How to debug selenium
MongoDB Java Driver Note
How to use partial
How to read JSON
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to update Spyder
How to build a Django (python) environment on docker
How to use IPython
How to install BayesOpt
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015