undefined reference to `vtable for boost::detail::thread_data_base'问题

来源:互联网 发布:linux 占用内存 脚本 编辑:程序博客网 时间:2024/06/05 06:33

同样是boost.asio中用到boost.thread处理I/O,编译出错:
undefined reference to `vtable for boost::detail::thread_data_base’

环境

ubuntu14.04
g++ 4.8.4

解决办法

I had the same question, but -lboost_thread-mt is now deprecated see this answer on askubuntu.com. Instead what you now want in your makefile (at least for linux) is:

-lpthread -lboost_thread …

参考

http://stackoverflow.com/questions/3584365/boost-thread-error-undefined-reference

1 0