boost中g++ 链接undefined reference to `boost::system::generic_category()问题

来源:互联网 发布:联合国全球贸易数据库 编辑:程序博客网 时间:2024/05/17 06:46

在使用boost库时,遇到了一个比较纠结的问题:

Test.cpp:(.text+0x1bd): undefined reference to `boost::system::generic_category()'
Test.cpp:(.text+0x1c7): undefined reference to `boost::system::generic_category()'
Test.cpp:(.text+0x1d1): undefined reference to `boost::system::system_category()'
放狗搜了下,感觉问题也是因而而异,但是普遍反映是在编译链接时,有库没有包含进去,我试了下,在g++的编译链接选项里加上 -lboost_system,即解决了问题,

1 0
原创粉丝点击