A boost library is required.
1. Download cxx-driver for 2.0, unzip to/usr/src folder
wget http://downloads.mongodb.org/cxx-driver/mongodb-linux-x86_64-v2.0-latest.tgz
2. sudo apt-Get install libpcre3-dev
3. sudo apt-Get install scons
Chenshu @ chenshu-Ubuntu:/usr/local/src/mongo-cxx-driver-v2.0 $
rm -f .sconsign.dblitescons --prefix=/usr install
Configure the sconstruct file if necessary. For example, if the boost library is located under/usr/lib, change the configuration from/usr/local to/usr.
4. If it is not installed in the/usr/lib directory, run the following command to copy it.
Sudo CP lib1_client. */usr/lib/
5. If you want to debug the source code during development, you need to find if Linux in the sconstruct file and add a line of-G parameters.
If Linux:
Env. append (linkflags = "-wl, -- as-needed-wl,-zdefs ")
Env. append (cppflags = "-G ")
After mongodb2.1, a bug occurs that the. So file cannot be compiled, but only the. A file can be compiled. Here is issue:
Https://jira.mongodb.org/browse/SERVER-6514? Page = com. Atlassian. Streams. streams-Jira-plugin: Activity-stream-issue-Tab
In the four-month period, this issue has no one to ask. It seems that MongoDB's core team is not as outstanding as the outside world imagined.
There are two bypass methods:
1. uncomment the 101 line of the src/sconscript. Client File and re-compile it.
2. Do not use the. So file and directly introduce the header file to your project.
# Include "src/Mongo/client/dbclient. H"