| {toc} |
| The C+\+ driver is included in the MongoDB server source repository, and can also be downloaded as a separate, "standalone" tarball (see [C\+\+ [DOCS:C++ Driver Download]). To compile the "standalone" C+\+ driver, run the scons command in the top-level directory of the driver sources, e.g.: |
{code}cd mongo-cxx-driver-nightly/ |
... |
The C++ driver is included in the MongoDB server source repository, and can also be downloaded as a separate, "standalone" tarball (see C++ Driver Download). To compile the "standalone" C++ driver, run the scons command in the top-level directory of the driver sources, e.g.:
cd mongo-cxx-driver-nightly/ scons
You may wish to compile and link client/simple_client_demo.cpp to verify that everything compiles and links fine.
$ cd mongo/client $ g++ simple_client_demo.cpp -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options
If you have a compatibility problem with the library, include mongo_client_lib.cpp in your project instead. For example:
g++ -I .. simple_client_demo.cpp mongo_client_lib.cpp -lboost_thread-mt -lboost_filesystem
Note: we tend to test MongoDB with Windows using Visual Studio 2010. 2008 works, although you may have to tweak settings in some cases.
Include mongoclient.lib in your application.
To build mongoclient.lib:
scons mongoclient
Alternatively, include client/mongo_client_lib.cpp in your project.
For Windows, see also:
Other notes for Windows:
| {toc} |
| The C+\+ driver is included in the MongoDB server source repository, and can also be downloaded as a separate, "standalone" tarball (see [Docs:downloads]). [C\+\+ Driver Download]). To compile the "standalone" C+\+ driver, run the scons command in the top-level directory of the driver sources, e.g.: |
{code}cd mongo-cxx-driver-nightly/ |
... |
The C++ driver is included in the MongoDB server source repository, and can also be downloaded as a separate, "standalone" tarball (see [C\+\+ Driver Download]). To compile the "standalone" C++ driver, run the scons command in the top-level directory of the driver sources, e.g.: