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

Already on GitHub? Sign in to your account

errors compiling with ubuntu precise libboost1.48.0 #1

Closed
jgrevich opened this Issue Oct 15, 2012 · 6 comments

Comments

Projects
None yet
2 participants
Contributor

jgrevich commented Oct 15, 2012

Any idea what is causing the problem with the compile?

dpkg --get-selections | grep boost
libboost-date-time1.48-dev          install
libboost-date-time1.48.0            install
libboost-serialization1.48-dev          install
libboost-serialization1.48.0            install
libboost-system1.48-dev             install
libboost-system1.48.0               install
libboost-thread1.48-dev             install
libboost-thread1.48.0               install
libboost1.48-dev                install
BoostStomp$ make
g++ -c -Wall -Wno-format -g -DDEBUG -Werror -O0 -DDEBUG_STOMP -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING  -c Main.cpp -I .  
g++ -c -Wall -Wno-format -g -DDEBUG -Werror -O0 -DDEBUG_STOMP -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING  -c BoostStomp.cpp -I .
g++ -c -Wall -Wno-format -g -DDEBUG -Werror -O0 -DDEBUG_STOMP -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING  -c StompFrame.cpp -I .
g++ -c -Wall -Wno-format -g -DDEBUG -Werror -O0 -DDEBUG_STOMP -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING  -c helpers.cpp -I .
g++ -o main -g -L/usr/lib/ -L/usr/local/lib -lboost_system -lboost_thread Main.o BoostStomp.o StompFrame.o helpers.o
Main.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
Main.o: In function `boost::asio::error::get_system_category()':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Main.o: In function `boost::asio::detail::posix_tss_ptr_create(unsigned int&)':
/usr/include/boost/asio/detail/impl/posix_tss_ptr.ipp:34: undefined reference to `pthread_key_create'
Main.o: In function `~posix_tss_ptr':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
BoostStomp.o: In function `~BoostStomp':
/home/jjg/BoostStomp/BoostStomp.cpp:85: undefined reference to `boost::thread::interrupt()'
/home/jjg/BoostStomp/BoostStomp.cpp:87: undefined reference to `boost::thread::~thread()'
BoostStomp.o: In function `STOMP::BoostStomp::do_subscribe(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jjg/BoostStomp/BoostStomp.cpp:501: undefined reference to `boost::this_thread::get_id()'
BoostStomp.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
BoostStomp.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
BoostStomp.o: In function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
BoostStomp.o: In function `boost::asio::detail::posix_thread::join()':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:42: undefined reference to `pthread_join'
BoostStomp.o: In function `boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:50: undefined reference to `pthread_create'
BoostStomp.o: In function `thread_data_base':
/usr/include/boost/thread/pthread/thread_data.hpp:67: undefined reference to `vtable for boost::detail::thread_data_base'
BoostStomp.o: In function `thread<boost::_bi::bind_t<void, boost::_mfi::mf1<void, STOMP::BoostStomp, boost::shared_ptr<boost::asio::io_service> >, boost::_bi::list2<boost::_bi::value<STOMP::BoostStomp*>, boost::_bi::value<boost::shared_ptr<boost::asio::io_service> > > > >':
/usr/include/boost/thread/detail/thread.hpp:204: undefined reference to `boost::thread::start_thread()'
BoostStomp.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*() const':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:54: undefined reference to `pthread_getspecific'
BoostStomp.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context>::operator boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context*() const':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:54: undefined reference to `pthread_getspecific'
BoostStomp.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator=(boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*)':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:60: undefined reference to `pthread_setspecific'
BoostStomp.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context>::operator=(boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context*)':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:60: undefined reference to `pthread_setspecific'
BoostStomp.o: In function `~thread_data':
/usr/include/boost/thread/detail/thread.hpp:40: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/usr/include/boost/thread/detail/thread.hpp:40: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
BoostStomp.o:(.rodata._ZTIN5boost6detail11thread_dataINS_3_bi6bind_tIvNS_4_mfi3mf1IvN5STOMP10BoostStompENS_10shared_ptrINS_4asio10io_serviceEEEEENS2_5list2INS2_5valueIPS7_EENSE_ISB_EEEEEEEE[typeinfo for boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, STOMP::BoostStomp, boost::shared_ptr<boost::asio::io_service> >, boost::_bi::list2<boost::_bi::value<STOMP::BoostStomp*>, boost::_bi::value<boost::shared_ptr<boost::asio::io_service> > > > >]+0x8): undefined reference to `typeinfo for boost::detail::thread_data_base'
StompFrame.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
helpers.o: In function `debug_print(boost::basic_format<char, std::char_traits<char>, std::allocator<char> >&)':
/home/jjg/BoostStomp/helpers.cpp:48: undefined reference to `boost::this_thread::get_id()'
helpers.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [main] Error 1
Contributor

jgrevich commented Oct 15, 2012

Same error occurs with 1.46.1 boost libs.

Owner

ekarak commented Oct 15, 2012

a first googlation on this error suggests its a library naming issue:
http://stackoverflow.com/questions/8194313/undefined-reference-with-boost-when-i-try-to-compile

I'm on LMDE (almost a pure Debian), here's my installed versions:
libboost-date-time1.46-dev install
libboost-date-time1.46.1 install
libboost-filesystem1.46-dev install
libboost-filesystem1.46.1 install
libboost-filesystem1.48.0 install
libboost-filesystem1.49.0 install
libboost-graph-parallel1.46-dev install
libboost-graph-parallel1.46.1 install
libboost-graph1.46-dev install
libboost-graph1.46.1 install
libboost-iostreams1.42.0 install
libboost-iostreams1.46-dev install
libboost-iostreams1.46.1 install
libboost-iostreams1.48.0 install
libboost-iostreams1.49.0 install
libboost-math1.46-dev install
libboost-math1.46.1 install
libboost-mpi-python1.46-dev install
libboost-mpi-python1.46.1 install
libboost-mpi1.46-dev install
libboost-mpi1.46.1 install
libboost-program-options1.46-dev install
libboost-program-options1.46.1 install
libboost-program-options1.48.0 deinstall
libboost-python1.46-dev install
libboost-python1.46.1 install
libboost-random1.46-dev install
libboost-random1.46.1 install
libboost-regex1.46-dev install
libboost-regex1.46.1 install
libboost-regex1.48.0 install
libboost-regex1.49.0 install
libboost-serialization1.46-dev install
libboost-serialization1.46.1 install
libboost-signals1.46-dev install
libboost-signals1.46.1 install
libboost-signals1.48.0 install
libboost-signals1.49.0 install
libboost-system1.46-dev install
libboost-system1.46.1 install
libboost-system1.48.0 install
libboost-system1.49.0 install
libboost-test1.46-dev install
libboost-test1.46.1 install
libboost-thread1.46-dev install
libboost-thread1.46.1 install
libboost-thread1.48.0 install
libboost-thread1.49.0 install
libboost-wave1.46-dev install
libboost-wave1.46.1 install
libboost1.46-all-dev install
libboost1.46-dev install
libboost1.46-doc install

@ekarak ekarak closed this Oct 15, 2012

@ekarak ekarak reopened this Oct 15, 2012

Owner

ekarak commented Oct 15, 2012

http://stackoverflow.com/questions/9325249/boost-libraries-linking-issues
it seems like a very common issue.. there are tons of similar questions.

Many thanks for the feedback!

Contributor

jgrevich commented Oct 15, 2012

Thanks for the pointers. I'll look further and see if I find a solution. I"m also testing with ubuntu lucid to see if it's an issue with precise or the newer versions of the boost libs.

I look forward to helping wherever I can with the project. Thanks for all the work thus far.

Contributor

jgrevich commented Oct 15, 2012

Still no luck. Hit me up in #openzwave on freenode if you get a chance. I'm now trying to build the boost libraries from source to see fi that sheds any light on the situation.

@ekarak ekarak closed this Dec 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment