我正在尝试为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