I downloaded the newest codes from http://dl.mongodb.org/dl/cxx-driver and compiled it as a static library on Ubuntu 12.04 & 12.10. My GCC is 4.7, and using CMake as a build system. Boost library: 1.48 on Ubuntu 12.04, 1.49 on Ubuntu 12.10.
Then, my two projects compiled successfully with mongodb client library, but the third project got link error below:
Linking CXX executable cml_cloud
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libmongoclient.a(log.o): In function mongo::LoggingManager::start(std::string const&, bool)':
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0x4c): undefined reference to
boost::filesystem3::detail::status(boost::filesystem3::path const&, boost::system::error_code*)'
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0x86): undefined reference to boost::filesystem3::detail::status(boost::filesystem3::path const&, boost::system::error_code*)'
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0xb8): undefined reference to
boost::filesystem3::detail::status(boost::filesystem3::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: * [bin/cml_cloud] Error 1
make[1]: * [bin/CMakeFiles/cml_cloud.dir/all] Error 2
make: * [all] Error 2
I never ran into this kind of problem before. How to solve it?