這真的很奇怪。首先,我不知道你可以刪除函數,其次,這發生在外部庫中。錯誤:使用刪除函數boost :: shared_mutex :: shared_mutex
錯誤的情況是,我正在使用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:
而[你的代碼再現問題](http://stackoverflow.com/help/mcve)是...? – Angew
我甚至不知道哪個代碼導致它。 –
然後你還沒有做足夠的事情來自己隔離和識別問題。但編譯器錯誤的起源(「'myprogram.h:2','myprogram.cpp:1'」)可能是一個很好的起點。如果這沒有幫助,只需繼續扔掉不涉及'shared_mutex'的代碼,直到錯誤消失。然後,你會更接近查明它。 – Angew