我如何通过boost使用线程池lib?

时间:2012-05-08 12:58:23

标签: c++ boost pool

我复制了/ 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

上述步骤是否正确?

0 个答案:

没有答案