Chcę zrobić aplikację typu klient-serwer. Pomyślałem, że warto wykorzystać to co jest gotowe w booście, więc wziąłem się za naukę boost::assio. Wziąłem na warsztat przykład: http://www.boost.org/doc/libs/1_51_0/doc/html/boost_asio/example/echo/blocking_tcp_echo_server.cpp
I tu zaczęły się problemy: błąd kompilacji. Okazało się, że boost z repo ubuntu jest conajmniej za stary, więc go usunąłem, ściągnąłem najnowszą wersję i zainstalowałem według wszystkich reguł (bootstrap, bjam, b2, na końcu jeszcze ldconfig). Wygląda na to, że zainstalowałem poprawnie, aczkolwiek teraz whereis boost nie zwraca nic. Ale przykładowe kody korzystające z boosta (header-only) działają.
Jednak teraz podczas próby linkowania przykładu z asio dostaję takie oto błędy:
g++ -L/usr/lib/ -lboost_filesystem -lboost_system -lboost_thread -lpthread server/main/main.cpp -o ../run/server.exe
/tmp/ccI6HQ28.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x59f): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x5a9): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x5b3): undefined reference to `boost::system::system_category()'
/tmp/ccI6HQ28.o: In function `boost::system::error_code::error_code()':
main.cpp:(.text._ZN5boost6system10error_codeC1Ev[boost::system::error_code::error_code()]+0x10): undefined reference to `boost::system::system_category()'
/tmp/ccI6HQ28.o: In function `boost::asio::error::get_system_category()':
main.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x7): undefined reference to `boost::system::system_category()'
/tmp/ccI6HQ28.o: In function `boost::thread_exception::thread_exception(int, char const*)':
main.cpp:(.text._ZN5boost16thread_exceptionC2EiPKc[boost::thread_exception::thread_exception(int, char const*)]+0x7): undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [server] Błąd 1
linkuję z :
LDFLAGS := -lboost_filesystem -lboost_system -lboost_thread -lpthread
Przejrzałem co się da w google, przekompilowywałem boosta, nic nie dało...
Może ktoś miał już z tym problem i wie jak to rozwiązać