boost.asio编译有错啊! tcp_async_echo_client.cpp:(.text+0x1f2):对‘boost::system::generic_category()’未定义的引用

# [error_01]
# tcp_async_echo_client.cpp:88:83: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
# tcp_async_echo_client.cpp:88:83: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
# /tmp/cc879aYR.o:在函数‘__static_initialization_and_destruction_0(int, int)’中:
# tcp_async_echo_client.cpp:(.text+0x1f2):对‘boost::system::generic_category()’未定义的引用
# tcp_async_echo_client.cpp:(.text+0x1fe):对‘boost::system::generic_category()’未定义的引用
# tcp_async_echo_client.cpp:(.text+0x20a):对‘boost::system::system_category()’未定义的引用
# /tmp/cc879aYR.o:在函数‘boost::system::error_code::error_code()’中:
# tcp_async_echo_client.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17):对‘boost::system::system_category()’未定义的引用
# /tmp/cc879aYR.o:在函数‘boost::this_thread::sleep(boost::posix_time::ptime const&)’中:
# tcp_async_echo_client.cpp:(.text._ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE[_ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE]+0x28):对‘boost::this_thread::hiden::sleep_until(timespec const&)’未定义的引用
# /tmp/cc879aYR.o:在函数‘boost::asio::error::get_system_category()’中:
# tcp_async_echo_client.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5):对‘boost::system::system_category()’未定义的引用
# collect2: error: ld returned 1 exit status
# 解决:
#   装了sudo apt-get install libasio-dev
#   还要装这个sudo apt-get install libboost-all-dev
 

参考网页:https://blog.csdn.net/tykgls/article/details/6822038

 

 

上一篇:python – 支持ASIO的多通道PyAudio


下一篇:Boost.Asio 网络编程([译]Boost.Asio基本原理)