我应该链接什么来定义 boost::thread_specific_ptr 及相关内容?

发布于 2024-11-08 11:00:31 字数 2817 浏览 0 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

毁虫ゝ 2024-11-15 11:00:31

在我的 Ubuntu 系统上,我使用 -lboost_thread (因为 libboost_thread.so 已经在我的 /usr/lib 中,我不需要任何 -L 选项)。

On my Ubuntu system I use -lboost_thread (since libboost_thread.so is already in my /usr/lib I don't need any -L options).

风流物 2024-11-15 11:00:31

如果您使用CMake,您可以:

find_package(Boost COMPONENTS thread REQUIRED)

include_directories(${Boost_INCLUDE_DIR})

target_link_libraries(you_lib
                     ${Boost_LIBRARIES}
)

If you are using CMake, you can:

find_package(Boost COMPONENTS thread REQUIRED)

include_directories(${Boost_INCLUDE_DIR})

target_link_libraries(you_lib
                     ${Boost_LIBRARIES}
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文