Installed in/usr/local/
Download mongodb-linux-x86_64-v1.6-latest.tar.gz, which is used for compiling boost.1.41, but boost in RedHat Linux is 1.33. It is wrong to use it to compile your own program. Therefore, you need to re-compile C ++ Driver.
Compiling MongoDB C ++ Driver requires the support of the following function libraries
1. boost download boost_000045_0.tar.gz, installed in/usr/local/
<略>
2. pcre-8.02.tar.gz downloaded by pcre
# Tar xzf pcre-8.02.tar.gz
# Cd pcre-8.02 ..;./configure
# Make install
You also need to install scons, the downloaded scons-2.0.1.noarch.rpm
# Rpm-ihv scons-2.0.1.noarch.rpm
Then you can compile it.
$ Scons -- extrapath =/usr/local
$./FirstExample
Using cursor
{"_ Id": {"$ oid": "4db54c518b5341da7a1e916c"}, "name": "eliot", "num": 15}
{"_ Id": {"$ oid": "4db54c518b5341da7a1e916d"}, "name": "sara", "num": 23}
0 {"_ id": {"$ oid": "4db54c518b5341da7a1e916c"}, "name": "eliot", "num": 15}
1 {}
It indicates that everything is normal. mongodb C ++ Driver is available.