Complete tool chain for developers on Windows:

  • Ubuntu Linux Subsystem on Windows 10 (recommended): Initially is Ubuntu 14.04 (Trusty)
  • Cygwin (for Windows before Windows 10)
  • Virtual Linux Machine (CentOS, Ubuntu,…)

GCC 6 and G++ 6 on Ubuntu 14 (Trusty):

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-6
$ sudo apt-get install g++-6

Default version of Boost C++ Library on Ubuntu 14 (Trusty) is 1.54:

$ sudo apt-get install libboost-all-dev

Library required by MongoDB C Driver, libbson:
https://github.com/mongodb/libbson

#dependencies
$ sudo apt-get install git-core automake autoconf libtool gcc
#build
$ git clone git://github.com/mongodb/libbson.git
$ cd libbson/
$ git checkout x.y.z #version
$ ./autogen.sh
$ make
$ sudo make install

Libraries and C/C++ headers should be in these directories of subdirectories, these headers and binaries are used for compiling and linking:

/usr/include
/usr/local/include
/usr/lib
/usr/local/lib

MongoDB C Driver:
http://mongoc.org/libmongoc/current/installing.html

#dependencies
$ sudo apt-get install pkg-config libssl-dev libsasl2-dev
#build
$ git clone https://github.com/mongodb/mongo-c-driver.git
$ cd mongo-c-driver
$ git checkout x.y.z #version
$ ./autogen.sh --with-libbson=bundled
$ make
$ sudo make install

MongDB C++ Driver:
https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/

#tarball
$ curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.2.tar.gz
$ tar -xzf r3.0.2.tar.gz
$ cd mongo-cxx-driver-r3.0.2/build
#configure
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
#build
$ make
$ sudo make install
Advertisements