我正在尝试将 Boost asio 库用于套接字。
我使用自制软件安装了 boostbrew install boost
构建完成后,我尝试了在 boost 网站上创建服务器的教程。
我所做的只是将该代码粘贴到一个名为main.cc
当我尝试编译时g++ main.cc
,出现此错误:
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccTbzxpk.o
boost::asio::error::get_system_category() in ccTbzxpk.o
boost::system::error_code::error_code()in ccTbzxpk.o
"boost::system::generic_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccTbzxpk.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
出了什么问题?