我正在嘗試爲Raspberry Pi交叉編譯一個大型項目。我正在使用由crosstool-ng,gcc版本4.7.3構建的工具鏈。當它看到std :: shared_future時編譯扼流圈。我得到這個錯誤:樹莓派工具鏈上的std :: shared_future
test.cpp:5:27: error: aggregate 'std::shared_future<int> xxx' has incomplete type and cannot be defined
及這裏的生成錯誤的源文件:
#include <future>
int main()
{
std::shared_future<int> xxx;
return 0;
}
這同一個源文件編譯成功的Rapsberry皮本身。這是一個crosstool工具鏈中的錯誤嗎?有沒有解決方法?我怎樣才能成功編譯?
你確定正確的標誌被傳遞給編譯器嗎?你有沒有任何C++ 11的支持? – Thibaut 2013-04-21 17:27:16
你可以得到'std :: future','std :: async'或'std :: thread'來編譯嗎? – juanchopanza 2013-04-21 17:30:42
對不起,忽略了我以前的評論,我剛剛意識到如果C++ 11根本就不存在,編譯器會抱怨include。 – Thibaut 2013-04-21 17:32:52