【发布时间】:2011-08-09 12:33:16
【问题描述】:
我已经安装了所有的boost库,但是编译的时候g++ sda.cpp -lboost_system -lboost_date_time -lboost_regex -lboost_thread -lboost_serialization
#include <boost/asio.hpp>
int main()
{
return 0;
}
我得到几个错误,编译失败。 我使用最新的 ubuntu 10.10。 编译器说:
/tmp/cc6bld0N.o:在函数“__static_initialization_and_destruction_0(int, int)”中: sda.cpp:(.text+0x52): undefined reference to `boost::system::generic_category()' sda.cpp:(.text+0x5e): undefined reference to `boost::system::generic_category()' sda.cpp:(.text+0x6a): undefined reference to `boost::system::system_category()' /tmp/cc6bld0N.o:在函数`boost::asio::error::get_system_category()'中: sda.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5): 未定义引用`boost::system::system_category()' collect2: ld 返回 1 个退出状态有什么问题?
【问题讨论】:
-
当你说“我已经安装了所有的 boost 库”时,你的意思是你安装了它的编译版本还是你从源代码构建并安装了它们?
标签: c++ compiler-errors boost-asio