Today I will describe in short how to compile C++ drivers for MongoDB over Ubuntu 14.04

Make new Directories

mkdir /root/mongodb-client-install

mkdir /root/mongodb-git

cd /root/mongodb-git

Getting the source code

git clone https://github.com/mongodb/mongo-cxx-driver.git

Install pre-requisites

apt-get install scons libboost-all-dev build-essential libsasl2-2 libsasl2-dev

cd /root/mongodb-git/mongodb-cxx-driver

Start building

scons –prefix=/root/mongodb-client-install install –sharedclient –ssl –use-sasl-client

Copy shared libmongoclient.so to /usr/lib

cd /root/mongodb-client-install/lib

cp libmongoclient.so /usr/lib

Update shared libraries in system

ldconfig -v

Installation is now complete. You can use any program that has been compiled with mongodb C++ drivers to execute over the system.

Compile MongoDB C++ Driver

One thought on “Compile MongoDB C++ Driver

  • September 26, 2017 at 10:13 am
    Permalink

    Hi there, I am getting an error while running “scons” even I followed steps properly. Below is the error:

    scons: *** No SConstruct file found.
    File “/usr/lib/scons/SCons/Script/Main.py”, line 905, in _main

    Reply

Leave a Reply