本文介绍了std :: shared_future上的Raspberry Pi工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Raspberry Pi交叉编译一个大型项目。我使用的工具链由crosstool-ng,gcc版本4.7.3。编译在看到std :: shared_future时会阻塞。我收到此错误:

I'm trying to cross-compile a large project for the Raspberry Pi. I'm using a toolchain built by crosstool-ng, gcc version 4.7.3. The compilation chokes when it sees std::shared_future. I get this error:

test.cpp:5:27: error: aggregate 'std::shared_future<int> xxx' has incomplete type and cannot be defined

这里是产生错误的源文件: p>

And here's the source file that generates that error:

#include <future>

int main()
{
  std::shared_future<int> xxx;
  return 0;
}

这个相同的源文件在Rapsberry Pi本身上成功编译。这是在crosstool工具链中的一个错误?有解决方法吗?

This same source file compiles successfully on the Rapsberry Pi itself. Is this a bug in the crosstool toolchain? Is there a workaround? How can I get this to successfully compile?

推荐答案

我通过@backlash和#gcc上的人解决了这个问题Freenode。 Crosstool-NG正在构建 armv7 的工具链,而Raspberry Pi的编译器正在编译 armv6 。将架构级别(目标选项>架构级别)更改为 armv6 允许我编译我原始问题中发布的示例代码。此选项为 gcc 的配置标志添加 - with-arch = armv6 。希望这有助于未来的人。

I solved this problem with help from @backlash and the people on #gcc on Freenode. Crosstool-NG was building the toolchain for armv7, while the Raspberry Pi's compiler was compiling for armv6. Changing the "Architecture level" (Target options > Architecture level) to armv6 allowed me to compile the sample code posted in my original question. This option adds a --with-arch=armv6 to the configure flags for gcc. Hope this helps someone out in the future.

这篇关于std :: shared_future上的Raspberry Pi工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 01:27