c++ - 试图编译 boost 依赖库 - "is private"错误

我正在尝试编译 https://code.google.com/p/feed-reader-lib/但在 Feed.cpp 上它给了我一个奇怪的错误。

/usr/include/boost/thread/pthread/recursive_mutex.hpp:40:9: error: ‘boost::recursive_mutex::recursive_mutex(const boost::recursive_mutex&)’ is private
Feed.cpp:49:69: error: within this context

我对 C++ 还太陌生,所以我绝对无法解释这里可能出了什么问题,因为编译器在声明状态下会引发此错误。上面的库没有任何问题——在我看来,boost 库是错误的(因为它错误地将 boost::recursive_mutex::recursive_mutex(const boost::recursive_mutex&) 设为私有(private))。但肯定不能这样。

我在这里错过了什么?

最佳答案

您收到的错误消息意味着试图复制不可复制的 recursive_mutex .打开Feed.cpp并更改以下行:

boost::recursive_mutex Feed::m_stateMutex = boost::recursive_mutex();

对此:
boost::recursive_mutex Feed::m_stateMutex;

关于c++ - 试图编译 boost 依赖库 - "is private"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16264908/

相关文章:

c++ - 无法在NetBeans IDE中编译C++-给出错误 “CreateProcess er

ios - UITextfield的语义问题

path - Makefile中的路径定义

actionscript-3 - AS3中的突破游戏错误#2007

c# - 建立安装程序时出错

java - 泛型错误-找不到符号类

mongodb - 在CentOS 6.3上编译mongo-perf时未定义的Boost引用

ios - XCode 未定义引用

c++ - VC++编译器忽略重载函数

ios - 无法将OCUnit测试框架添加到现有Xcode项目中