我应该链接什么来定义 boost::thread_specific_ptr 及相关内容?
我想使用 boost::thread_specific_ptr 但需要知道要添加到我的 gcc v3.4.6 链接行中来定义它的用途:
/usr/include/boost/thread/tss.hpp:35: undefined reference to `boost::thread_resource_error::thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x5b):/usr/include/boost/thread/tss.hpp:35: undefined reference to `boost::thread_resource_error::~thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x60):/usr/include/boost/thread/tss.hpp:35: undefined reference to `typeinfo for boost::thread_resource_error'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x76):/usr/include/boost/thread/tss.hpp:38: undefined reference to `boost::detail::tss::init(boost::function1<void, void*, std::allocator<boost::function_base> >*)'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xd2):/usr/include/boost/thread/tss.hpp:43: undefined reference to `boost::thread_resource_error::thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xf8):/usr/include/boost/thread/tss.hpp:43: undefined reference to `boost::thread_resource_error::~thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xfd):/usr/include/boost/thread/tss.hpp:43: undefined reference to `typeinfo for boost::thread_resource_error'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZNK5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE3getEv+0x11): In function `boost::thread_specific_ptr<Botan::AutoSeeded_RNG>::get() const':
/usr/include/boost/thread/tss.hpp:89: undefined reference to `boost::detail::tss::get() const'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE5resetEPS2_+0x2f): In function `boost::thread_specific_ptr<Botan::AutoSeeded_RNG>::reset(Botan::AutoSeeded_RNG*)':
/usr/include/boost/thread/tss.hpp:97: undefined reference to `boost::detail::tss::set(void*)'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE5resetEPS2_+0x4a):/usr/include/boost/thread/tss.hpp:98: undefined reference to `boost::detail::tss::cleanup(void*)'
我应该链接什么来定义所有这些?
I want to use boost::thread_specific_ptr but need to know what to add to my gcc v3.4.6 link line to define what it uses:
/usr/include/boost/thread/tss.hpp:35: undefined reference to `boost::thread_resource_error::thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x5b):/usr/include/boost/thread/tss.hpp:35: undefined reference to `boost::thread_resource_error::~thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x60):/usr/include/boost/thread/tss.hpp:35: undefined reference to `typeinfo for boost::thread_resource_error'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0x76):/usr/include/boost/thread/tss.hpp:38: undefined reference to `boost::detail::tss::init(boost::function1<void, void*, std::allocator<boost::function_base> >*)'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xd2):/usr/include/boost/thread/tss.hpp:43: undefined reference to `boost::thread_resource_error::thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xf8):/usr/include/boost/thread/tss.hpp:43: undefined reference to `boost::thread_resource_error::~thread_resource_error()'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost6detail3tssC1EPNS_9function1IvPvSaINS_13function_baseEEEE+0xfd):/usr/include/boost/thread/tss.hpp:43: undefined reference to `typeinfo for boost::thread_resource_error'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZNK5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE3getEv+0x11): In function `boost::thread_specific_ptr<Botan::AutoSeeded_RNG>::get() const':
/usr/include/boost/thread/tss.hpp:89: undefined reference to `boost::detail::tss::get() const'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE5resetEPS2_+0x2f): In function `boost::thread_specific_ptr<Botan::AutoSeeded_RNG>::reset(Botan::AutoSeeded_RNG*)':
/usr/include/boost/thread/tss.hpp:97: undefined reference to `boost::detail::tss::set(void*)'
../../src/utility/ARCH.linux_26_i86/debug/libmyApp.a(system.o)(.gnu.linkonce.t._ZN5boost19thread_specific_ptrIN5Botan14AutoSeeded_RNGEE5resetEPS2_+0x4a):/usr/include/boost/thread/tss.hpp:98: undefined reference to `boost::detail::tss::cleanup(void*)'
What should I be linking in to define all of these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我的 Ubuntu 系统上,我使用
-lboost_thread
(因为libboost_thread.so
已经在我的/usr/lib
中,我不需要任何-L
选项)。On my Ubuntu system I use
-lboost_thread
(sincelibboost_thread.so
is already in my/usr/lib
I don't need any-L
options).如果您使用
CMake
,您可以:If you are using
CMake
, you can: