It was frustrating last night that a tested program reported a link failure after upgrading to the latest MongoDB 2.4 C ++ driver. It's not easy.
/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 toboost::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 toboost::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]
We intend to re-compile the boost library with GCC, and then re-compile the libraries on which all applications depend. After a pause, I suddenly thought of an experience I had learned over the past few years. I changed the link order.
This is my post on stackoverflow and also my answer.
Http://stackoverflow.com/questions/16159356/mongodb-2-4-c-driver-causes-link-error/16166274? Noredirect = 1 #16166274
Then one enthusiastic person told me to refer to the GCC article and explain the link sequence.
Http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html
To sum up, database a depends on Database B, and database A must be on the left.