【发布时间】:2015-11-10 12:36:14
【问题描述】:
这真的很奇怪。首先我不知道你可以删除函数,其次,这发生在外部库中。
错误的情况是我正在使用 QtCreator 构建项目并一起提升,没有任何静态库。
使用的编译器是gcc
myprogram.h:4:7: error: use of deleted function 'boost::shared_mutex::shared_mutex(const boost::shared_mutex&)'
In file included from ../libs/boost155/boost/thread/lock_guard.hpp:11:0,
from ../libs/boost155/boost/thread/pthread/thread_data.hpp:11,
from ../libs/boost155/boost/thread/thread_only.hpp:17,
from ../libs/boost155/boost/thread/thread.hpp:12,
from ../libs/boost155/boost/thread.hpp:13,
from myprogram.h:2,
from myprogram.cpp:1:
【问题讨论】:
-
我什至不知道是哪个代码导致的。
-
那么您在自己隔离和识别问题方面做得还不够。但是编译器错误的来源(“
myprogram.h:2,myprogram.cpp:1”)可能是一个很好的起点。如果这没有帮助,只需继续丢弃不涉及shared_mutex的代码,直到错误消失。然后,您将更接近精确定位。