Monday, November 19, 2012

Building Mongo simple_client_demo.cpp

Instructions on the mongodb website are incomplete.

sudo yum install gcc gcc-c++ scons

The boost libraries are part of the mongo source downloads. You shouldn't have to install any external libraries.

To build the libraries run:

>scons all

Then cd into the directory with the C++ client libraries and test build the sample programs there. The instructions in the top of the simple_client_demo.cpp are incorrect. Use the below instead.

[dc@rshw client]$ g++ simple_client_demo.cpp -I/home/dc/mongodb-src-r2.2.1/src -I/home/dc/mongodb-src-r2.2.1/src/third_party/boost/ -L/home/dc/mongodb-src-r2.2.1/build/linux2/normal/client_build -L /home/dc/mongodb-src-r2.2.1/build/linux2/normal/third_party/boost -lmongoclient  -lboost_filesystem -lboost_program_options -lboost_system -lpthread -lboost_thread


No comments:

Post a Comment