Help compiling/linking boost example
I installed boost-all-dev using apt-get on Ubuntu.
I am trying to compile this example program of sync_client.cpp
http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/example/http/client...
I get this error ..
$ sudo g++ sync_client.cpp -I usr/local/include/boost -L /usr/local/lib
/tmp/ccaVkCWp.o: In function
`__static_initialization_and_destruction_0(int, int)':
sync_client.cpp:(.text+0xd61): undefined reference to
`boost::system::generic_category()'
sync_client.cpp:(.text+0xd6d): undefined reference to
`boost::system::generic_category()'
sync_client.cpp:(.text+0xd79): undefined reference to
`boost::system::system_category()'
/tmp/ccaVkCWp.o: In function `boost::system::error_code::error_code()':
sync_client.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17):
undefined reference to `boost::system::system_category()'
/tmp/ccaVkCWp.o: In function `boost::asio::error::get_system_category()':
sync_client.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5):
undefined reference to `boost::system::system_category()'
/tmp/ccaVkCWp.o: In function
`boost::asio::detail::posix_tss_ptr_create(unsigned int&)':
sync_client.cpp:(.text._ZN5boost4asio6detail20posix_tss_ptr_createERj[boost::asio::detail::posix_tss_ptr_create(unsigned
int&)]+0x19): undefined reference to `pthread_key_create'
/tmp/ccaVkCWp.o: In function
`boost::asio::detail::posix_thread::~posix_thread()':
sync_client.cpp:(.text._ZN5boost4asio6detail12posix_threadD2Ev[_ZN5boost4asio6detail12posix_threadD5Ev]+0x26):
undefined reference to `pthread_detach'
/tmp/ccaVkCWp.o: In function `boost::asio::detail::posix_thread::join()':
sync_client.cpp:(.text._ZN5boost4asio6detail12posix_thread4joinEv[boost::asio::detail::posix_thread::join()]+0x2b):
undefined reference to `pthread_join'
/tmp/ccaVkCWp.o: In function
`boost::asio::detail::posix_tss_ptr
participants (1)
-
zaphod742 .