This version is different from the previous one. It has a dedicated github project.
Https://github.com/mongodb/mongo-cxx-driver
First, obtain the source code:
git clone https://github.com/mongodb/mongo-cxx-driver.git
Switch the branch:
git checkout 26compat
Then compile with the following command:
scons --prefix=/usr --use-system-boost --sharedclient --full install-mongoclient
This command will compile the. so and. a libraries, which are located in the build directory:
# Ls build/linux2/use-system-boost/lib1_client. a-alh-rw-r -- 1 root 57 M May 10 23:35 build/linux2/use-system-boost/lib1_client. a # ls build/linux2/use-system-boost/lib1_client. so-alh-rwxr-xr-x 1 root 20 M May 10 23:37 build/linux2/use-system-boost/lib1_client. so
And installed in the/usr/lib/directory. the header file is in the/usr/include directory.
# Ls/usr/lib/lib1_client. *-alh-rw-r -- 1 root 57 M May 10 23:35/usr/lib/lib1_client. a-rwxr-xr-x 1 root 20 M May 10 23:37/usr/lib/lib1_client. so
# ls /usr/include/mongo/base bson buildinfo.cpp client db logger pch.cpp pch.h platform s scripting server.h shell targetver.h util
After two years of waiting, MongoDB's C ++ driver is like a normal product.