我正在運行一個簡單的例子,在fedora xfce上進行boost asio,並且它給出了這些錯誤...任何想法?提升asio示例測試失敗
#include <boost/asio.hpp>
#include <iostream>
int main(int argc, char * argv[])
{
boost::asio::io_service io_service;
io_service.run();
std::cout << "Do you reckon this line displays?" << std::endl;
return 0;
}
輸出:
obj/Debug/main.o||In function `__static_initialization_and_destruction_0':|
/usr/include/boost/system/error_code.hpp|214|undefined reference to `boost::system::generic_category()'|
/usr/include/boost/system/error_code.hpp|215|undefined reference to `boost::system::generic_category()'|
/usr/include/boost/system/error_code.hpp|216|undefined reference to `boost::system::system_category()'|
obj/Debug/main.o||In function `boost::system::error_code::error_code()':|
/usr/include/boost/system/error_code.hpp|315|undefined reference to `boost::system::system_category()'|
obj/Debug/main.o||In function `boost::asio::error::get_system_category()':|
/usr/include/boost/asio/error.hpp|216|undefined reference to `boost::system::system_category()'|
||=== Build finished: 5 errors, 0 warnings (0 minutes, 1 seconds) ===|
對於它的價值,我使用Boost 1.49在Windows 8下編譯和鏈接測試程序,沒有編譯錯誤。所以至少你知道你的程序沒有什麼有機錯誤。 –