我已经安装了所有Boost库,但在编译g++ sda.cpp -lboost_system -lboost_date_time -lboost_regex -lboost_thread -lboost_serialization
编译程序与Boost.Asio的库
#include <boost/asio.hpp>
int main()
{
return 0;
}
我得到几个错误时,和编译失败。 我使用最新的Ubuntu 10.10。 编译器说:
/tmp/cc6bld0N.o: In function `__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: In function `boost::asio::error::get_system_category()': sda.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5): undefined reference to `boost::system::system_category()' collect2: ld returned 1 exit status
什么问题?
当你说“我已经安装了所有boost库”,你的意思是你安装了它的编译版本,还是从源代码构建并安装了它们? – yasouser 2011-04-20 14:24:19