Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 升压池:我可以从升压系统断开它吗?_C++_Boost - Fatal编程技术网

C++ 升压池:我可以从升压系统断开它吗?

C++ 升压池:我可以从升压系统断开它吗?,c++,boost,C++,Boost,1.53.0中的pool文档声称它是“仅标题”。但是,最低限度的计划: #include <boost/pool/pool_alloc.hpp> int main() { return 0; } #包括 int main(){ 返回0; } 最后是来自boost\u系统的未定义符号,而bcp认为需要boost\u系统。是否有#define或解决此问题的方法?这是一个已知的错误 如果您不需要多线程,我们可以 修改pool/detail/mutex.hpp以不包括URL中所述

1.53.0中的
pool
文档声称它是“仅标题”。但是,最低限度的计划:

#include <boost/pool/pool_alloc.hpp>

int main() {
  return 0;
}
#包括
int main(){
返回0;
}
最后是来自
boost\u系统
的未定义符号,而
bcp
认为需要
boost\u系统
。是否有
#define
或解决此问题的方法?

这是一个已知的错误

  • 如果您不需要多线程,我们可以 修改
    pool/detail/mutex.hpp
    以不包括URL中所述的

    ...
    #if defined(BOOST_HAS_THREADS) && !defined(BOOST_NO_MT) && !defined(BOOST_POOL_NO_MT) 
    #include <boost/thread/mutex.hpp>
    #endif
    ...
    

您需要线程支持吗?如果没有,你能试着定义一下
BOOST\u POOL\u NO\u MT
?我想那应该是
BOOST/POOL/POOL\u alloc.hpp
#define BOOST_POOL_NO_MT       // disable multi-threading
#define BOOST_THREAD_MUTEX_HPP // define the #include-guard to disable the header

#include <boost/pool/pool_alloc.hpp>

int main () {}
#define BOOST_THREAD_MUTEX_HPP
#include <mutex>
namespace boost {
    using std::mutex;
}

#include <boost/pool/pool_alloc.hpp>

int main () {}