不能包含 boost.asio
我试图包含 boost.asio 库,但每当我这样做时,我都会收到此错误消息:
undefined reference to `boost::system::generic_category()'
我可以包含任何其他 boost 库,但不能包含这个库。
我尝试像这样链接 boost.System:
icpc -lboost_system main.cpp -o out.o
它给了我这条消息
ld: cannot find -lboost_system
I am trying to include boost.asio library, but whenever I do that I get this error message:
undefined reference to `boost::system::generic_category()'
I can include any other boost library, but not this one.
I tried to link boost.System like this:
icpc -lboost_system main.cpp -o out.o
It gave me this message
ld: cannot find -lboost_system
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要链接
Boost.System
才能让 Asio 工作。 请参见此处。You need to link
Boost.System
in order for Asio to work. See here.正如 @Space_C0wb0y 所回避的,您需要构建 Boost.System 或使用其正确的名称进行链接(例如 -lboost_system-mt)。
As eluded to by @Space_C0wb0y, you need to either build Boost.System or use its correct name for linking (e.g. -lboost_system-mt).