Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking issues with boost causing undefined symbol errors on linux (RHEL 6.5) #6

Open
rp2014 opened this issue Aug 17, 2014 · 1 comment

Comments

@rp2014
Copy link

rp2014 commented Aug 17, 2014

Seeing many issues during linking, while building the Redis3m package. I have verified the boost include and lib path and have recent boost release installed (1.54). cut-paste few errors I am seeing below.

Linking CXX executable connection_pool_test
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function init_unit_test()': connection_pool.cpp:(.text+0x93): undefined reference toboost::unit_test::framework::master_test_suite()'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function consumer_f(boost::shared_ptr<redis3m::connection_pool>, std::string const&)': connection_pool.cpp:(.text+0x297): undefined reference toboost::this_thread::yield()'
connection_pool.cpp:(.text+0x2a6): undefined reference to boost::this_thread::interruption_requested()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionproducer_f(boost::shared_ptrredis3m::connection_pool, std::string const&)':
connection_pool.cpp:(.text+0x83c): undefined reference to boost::this_thread::yield()' connection_pool.cpp:(.text+0x84b): undefined reference toboost::this_thread::interruption_requested()'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function test_pool::test_method()': connection_pool.cpp:(.text+0xea0): undefined reference toboost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring, unsigned long, boost::unit_test::basic_cstring)'
connection_pool.cpp:(.text+0x10d9): undefined reference to boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functioncrash_test::test_method()':
connection_pool.cpp:(.text+0x16f9): undefined reference to boost::this_thread::disable_interruption::disable_interruption()' connection_pool.cpp:(.text+0x176b): undefined reference toboost::this_thread::disable_interruption::~disable_interruption()'
connection_pool.cpp:(.text+0x194d): undefined reference to boost::this_thread::disable_interruption::~disable_interruption()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::detail::thread_data<boost::_bi::bind_t<void, void ()(boost::shared_ptrredis3m::connection_pool, std::string const&), boost::_bi::list2boost::_bi::value<boost::shared_ptr<redis3m::connection_pool >, boost::_bi::value<char const> > > >::~thread_data()':
connection_pool.cpp:(.text._ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED2Ev[_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED5Ev]+0x36): undefined reference to boost::detail::thread_data_base::~thread_data_base()' connection_pool.cpp:(.text._ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED2Ev[_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED5Ev]+0x2b): undefined reference toboost::detail::thread_data_base::~thread_data_base()'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(boost::shared_ptr<redis3m::connection_pool>, std::string const&), boost::_bi::list2<boost::_bi::value<boost::shared_ptr<redis3m::connection_pool> >, boost::_bi::value<char const*> > > >::~thread_data()': connection_pool.cpp:(.text._ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED0Ev[_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED0Ev]+0x25): undefined reference toboost::detail::thread_data_base::~thread_data_base()'
connection_pool.cpp:(.text._ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED0Ev[_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEED0Ev]+0x3e): undefined reference to boost::detail::thread_data_base::~thread_data_base()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::unit_test::make_test_case(boost::unit_test::callback0boost::unit_test::ut_detail::unused const&, boost::unit_test::basic_cstring)':
connection_pool.cpp:(.text.ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE[ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE]+0x13): undefined reference to boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)' connection_pool.cpp:(.text._ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE[_ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE]+0x3d): undefined reference toboost::unit_test::test_case::test_case(boost::unit_test::basic_cstring, boost::unit_test::callback0boost::unit_test::ut_detail::unused const&)'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function _GLOBAL__sub_I__Z14init_unit_testv': connection_pool.cpp:(.text.startup+0x4d): undefined reference toboost::system::generic_category()'
connection_pool.cpp:(.text.startup+0x59): undefined reference to boost::system::generic_category()' connection_pool.cpp:(.text.startup+0x65): undefined reference toboost::system::system_category()'
connection_pool.cpp:(.text.startup+0xdd): undefined reference to boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, unsigned long)' connection_pool.cpp:(.text.startup+0x145): undefined reference toboost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case
, unsigned long)'
connection_pool.cpp:(.text.startup+0x17d): undefined reference to vtable for boost::unit_test::unit_test_log_t' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionmain':
connection_pool.cpp:(.text.startup+0xb): undefined reference to boost::unit_test::unit_test_main(bool (_)(), int, char*_)' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function boost::thread_exception::thread_exception(int, char const
)':
connection_pool.cpp:(.text._ZN5boost16thread_exceptionC2EiPKc[ZN5boost16thread_exceptionC5EiPKc]+0x14): undefined reference to boost::system::system_category()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::condition_error::condition_error(int, char const)':
connection_pool.cpp:(.text._ZN5boost15condition_errorC2EiPKc[_ZN5boost15condition_errorC5EiPKc]+0x14): undefined reference to boost::system::system_category()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::thread_group::~thread_group()':
connection_pool.cpp:(.text._ZN5boost12thread_groupD2Ev[_ZN5boost12thread_groupD5Ev]+0x1d): undefined reference to boost::thread::detach()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::condition_variable::condition_variable()':
connection_pool.cpp:(.text._ZN5boost18condition_variableC2Ev[_ZN5boost18condition_variableC5Ev]+0x3d): undefined reference to boost::system::system_category()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::thread::thread<boost::bi::bind_t<void, void ()(boost::shared_ptrredis3m::connection_pool, std::string const&), boost::_bi::list2boost::_bi::value<boost::shared_ptr<redis3m::connection_pool >, boost::_bi::value<char const*> > > >(boost::_bi::bind_t<void, void ()(boost::shared_ptrredis3m::connection_pool, std::string const&), boost::_bi::list2boost::_bi::value<boost::shared_ptr<redis3m::connection_pool >, boost::_bi::value<char const> > >, boost::disable_if_c<boost::thread_detail::is_convertible<boost::_bi::bind_t<void, void ()(boost::shared_ptrredis3m::connection_pool, std::string const&), boost::_bi::list2boost::_bi::value<boost::shared_ptr<redis3m::connection_pool >, boost::_bi::value<char const> > >&, boost::detail::thread_move_t<boost::bi::bind_t<void, void ()(boost::shared_ptrredis3m::connection_pool, std::string const&), boost::_bi::list2boost::_bi::value<boost::shared_ptr<redis3m::connection_pool >, boost::_bi::value<char const> > > > >::value, boost::thread::dummy>::type)':
connection_pool.cpp:(.text._ZN5boost6threadC2INS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEET_NS_12disable_if_cIXsrNS_13thread_detail14is_convertibleIRSK_NS_6detail13thread_move_tISK_EEEE5valueEPNS0_5dummyEE4typeE[_ZN5boost6threadC5INS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEET_NS_12disable_if_cIXsrNS_13thread_detail14is_convertibleIRSK_NS_6detail13thread_move_tISK_EEEE5valueEPNS0_5dummyEE4typeE]+0x54): undefined reference to vtable for boost::detail::thread_data_base' connection_pool.cpp:(.text._ZN5boost6threadC2INS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEET_NS_12disable_if_cIXsrNS_13thread_detail14is_convertibleIRSK_NS_6detail13thread_move_tISK_EEEE5valueEPNS0_5dummyEE4typeE[_ZN5boost6threadC5INS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEET_NS_12disable_if_cIXsrNS_13thread_detail14is_convertibleIRSK_NS_6detail13thread_move_tISK_EEEE5valueEPNS0_5dummyEE4typeE]+0x269): undefined reference toboost::thread::start_thread_noexcept()'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In function boost::condition_variable::wait(boost::unique_lock<boost::mutex>&)': connection_pool.cpp:(.text._ZN5boost18condition_variable4waitERNS_11unique_lockINS_5mutexEEE[_ZN5boost18condition_variable4waitERNS_11unique_lockINS_5mutexEEE]+0x15): undefined reference toboost::detail::get_current_thread_data()'
connection_pool.cpp:(.text._ZN5boost18condition_variable4waitERNS_11unique_lockINS_5mutexEEE[ZN5boost18condition_variable4waitERNS_11unique_lockINS_5mutexEEE]+0x78): undefined reference to boost::this_thread::interruption_point()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::thread_group::add_thread(boost::thread)':
connection_pool.cpp:(.text._ZN5boost12thread_group10add_threadEPNS_6threadE[_ZN5boost12thread_group10add_threadEPNS_6threadE]+0x23): undefined reference to boost::this_thread::disable_interruption::disable_interruption()' connection_pool.cpp:(.text._ZN5boost12thread_group10add_threadEPNS_6threadE[_ZN5boost12thread_group10add_threadEPNS_6threadE]+0x89): undefined reference toboost::this_thread::disable_interruption::~disable_interruption()'
connection_pool.cpp:(.text._ZN5boost12thread_group10add_threadEPNS_6threadE[_ZN5boost12thread_group10add_threadEPNS_6threadE]+0xd9): undefined reference to boost::this_thread::disable_interruption::~disable_interruption()' CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o: In functionboost::thread_group::join_all()':
connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0x22): undefined reference to boost::this_thread::disable_interruption::disable_interruption()' connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0x7c): undefined reference toboost::this_thread::disable_interruption::~disable_interruption()'
connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0x9d): undefined reference to boost::thread::joinable() const' connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0xad): undefined reference toboost::thread::native_handle()'
connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0xc2): undefined reference to boost::thread::join_noexcept()' connection_pool.cpp:(.text._ZN5boost12thread_group8join_allEv[_ZN5boost12thread_group8join_allEv]+0x14f): undefined reference toboost::this_thread::disable_interruption::~disable_interruption()'
CMakeFiles/connection_pool_test.dir/tests/connection_pool.cpp.o:(.rodata._ZTIN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEE[_ZTIN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvNS_10shared_ptrIN7redis3m15connection_poolEEERKSsENS2_5list2INS2_5valueIS7_EENSD_IPKcEEEEEEEE]+0x10): undefined reference to typeinfo for boost::detail::thread_data_base' libredis3m.so.2.0.0: undefined reference toboost::this_thread::hiden::sleep_until(timespec const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [connection_pool_test] Error 1
make[1]: *** [CMakeFiles/connection_pool_test.dir/all] Error 2
make: *** [all] Error 2

@vbirdGit
Copy link

I met the same problem with you. Did you resolve it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants