
n179911 wrote:
I have compiled and installed my boost library in '/media/data/bin' in ubuntu 9.10. And I have setup the INCLUDE_PATH, LIBRARY_PATH env:
$ echo $INCLUDE_PATH /media/data/bin/boost/include: $ echo $LIBRARY_PATH /media/data/bin/boost/lib:
But when I compile the asio example, I get the following error:
$ g++ blocking_tcp_echo_server.cpp blocking_tcp_echo_server.cpp:13:26: error: boost/bind.hpp: No such
What makes you think that the INCLUDE_PATH environment variable has any effect? 'man gcc' suggests it does not.
$ g++ -I/media/data/bin/boost/include -L/media/data/bin/boost/lib blocking_tcp_echo_server.cpp /usr/bin/ld: /tmp/ccBXjXeh.o: in function server(boost::asio::io_service&, short):blocking_tcp_echo_server.cpp(.text+0x39e): error: undefined reference to 'boost::thread::~thread()'
Haven't we been here before? For example, in http://old.nabble.com/Using-boost-library-on-MacOSx-td24645759.html you ask essentially the same questions. There answer here is the same as there -- you don't link to the required libraries, and in this case, it's pretty easy to guess that the required libraries are called Boost.Thread...
__static_initialization_and_destruction_0(int, int):blocking_tcp_echo_server.cpp(.text+0x5ea): error: undefined reference to 'boost::system::get_system_category()'
... and Boost.System. And you got exactly the same error about Boost.System before. boost::asio::detail::posix_thread::~posix_thread():blocking_tcp_echo_server.cpp(.text._ZN5boost4asio6detail12posix_threadD1Ev+0x1d):
error: undefined reference to 'pthread_detach' /usr/bin/ld: /tmp/ccBXjXeh.o: in function
Add -pthread command line option. - Volodya P.S. I suggest you *do not* ask the same question at the same time both on this mailing list, and on any other web sites. This results in nothing by duplication of effort.