0

我复制了/usr/include/boost下的boost hpp文件,发布版本是1.37.0,我还复制了/usr/include/boost下的threadpool hpp文件。

运行gcc quickstart.cpp -o test编译失败并显示以下输出。

编译日志输出:

$ g++ quickstart.hpp -o test
/tmp/cctYmYW8.o:quickstart.cpp (.text$_ZN5boost16thread_exceptionC2ERKS0_[boost::thread_exception::thread_exception(boost::thread_exception const&)]+0x1d): undefined reference to vtable for boost::thread_exception
/tmp/cctYmYW8.o:quickstart.cpp:(.text$_ZN5boost21thread_resource_errorC1ERKS0_[boost::thread_resource_error::thread_resource_error(boost::thread_resource_error const&)]+0x1d): undefined reference tovtable for boost::thread_resource_error'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
/tmp/cctYmYW8.o: bad reloc address 0x1d in section `.text$_ZN5boost21thread_resource_errorC1ERKS0_[boost::thread_resource_error::thread_resource_error(boost::thread_resource_error const&)]' collect2: ld

以上步骤正确吗?

4

0 回答 0