The GCC link sequence causes the MongoDB application link to fail.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.