【问题标题】:trying to compile boost dependent library - "is private" error试图编译 boost 依赖库 - “是私有的”错误
【发布时间】:2013-04-28 16:17:04
【问题描述】:

我正在尝试编译 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&) 设为私有)。但肯定不能这样。

我在这里错过了什么?

【问题讨论】:

    标签: c++ gcc boost compiler-errors


    【解决方案1】:

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

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

    到这里:

    boost::recursive_mutex Feed::m_stateMutex;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-22
      • 2016-03-24
      • 2012-10-20
      • 1970-01-01
      • 1970-01-01
      • 2016-02-25
      • 1970-01-01
      相关资源
      最近更新 更多