I have downloaded the latest version of MongoDB C++ driver for my os x from http://dl.mongodb.org/dl/cxx-driver. Then I extracted using tar xvf command in os x terminal. After t
It took me a while to get this working. Hopefully you can get yours working from the following steps:
Create a new C++ project in Xcode
I copied the code from
as a test
In Build Settings/Search Paths:
Add the following to your Header Search Paths
:
/path/to/mongo-cxx-driver-nightly/src
and your equivalent path for the boost library header files (the folder should contain a boost
folder):
/usr/local/Cellar/boost/1.54.0/include
Add the following to your Library Search Paths
:
/usr/local/lib (in my case holds all of the boost libraries)
/path/to/mongo-cxx-driver-nightly
Link Binaries
In the Build Phases/Link Binary with Libraries
settings:
Add the following binaries:
/path/to/mongo-cxx-driver-nightly/libmongoclient.a
/usr/local/lib/libboost_thread-mt.dylib
/usr/local/lib/libboost_system-mt.dylib
/usr/local/lib/libboost_filesystem-mt.dylib
/usr/local/lib/libboost_program_options-mt.dylib