gpt4 book ai didi

c++ - boost线程池库中的问题

转载 作者:行者123 更新时间:2023-11-28 03:59:16 25 4
gpt4 key购买 nike

我想使用来自开源的 boost 线程池库 (http://threadpool.sourceforge.net/) 我在示例程序本身遇到编译错误。

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp: 在构造函数中 âboost::threadpool::detail::locking_ptr::locking_ptr(volatile T&, const volatile Mutex&) [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex ]â:

/usr/include/boost/./threadpool/./detail/pool_core.hpp:331:从 bool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost: :function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

/usr/include/boost/./threadpool/size_policies.hpp:75: 从 âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â

/usr/include/boost/./threadpool/pool.hpp:103:从boost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

./example/mergesort/mergesort.cpp:152: 从这里实例化

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:50: 错误:类 boost::recursive_mutex 没有名为“锁”的成员

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:在析构函数中âboost::threadpool::detail::locking_ptr::~locking_ptr() [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:

/usr/include/boost/./threadpool/./detail/pool_core.hpp:331:从 bool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost: :function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

/usr/include/boost/./threadpool/size_policies.hpp:75: 从 âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â

/usr/include/boost/./threadpool/pool.hpp:103:从boost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

./example/mergesort/mergesort.cpp:152: 从这里实例化

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:58: 错误:类 boost::recursive_mutex 没有名为“unlock”的成员

有人可以帮助解决这个问题吗?

问候,阿南丹

最佳答案

它似乎与您安装的 boost 版本不兼容。你有什么 Boost 版本?

关于c++ - boost线程池库中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1699170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com