问题描述
我正在尝试为 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
这是产生该错误的源文件:
And here's the source file that generates that error:
#include <future>
int main()
{
std::shared_future<int> xxx;
return 0;
}
同样的源文件在 Rapsberry Pi 本身上编译成功.这是交叉工具工具链中的错误吗?有解决方法吗?我怎样才能让它成功编译?
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 和 Freenode 上 #gcc 上的人的帮助下解决了这个问题.Crosstool-NG 正在为 armv7 构建工具链,而 Raspberry Pi 的编译器正在为 armv6 编译.将架构级别"(目标选项 > 架构级别)更改为 armv6 允许我编译我原始问题中发布的示例代码.此选项将 --with-arch=armv6 添加到 gcc 的配置标志.希望这对将来有人有所帮助.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)