I downloaded 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/
<Omitted>
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.