首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu14.04上在交叉编译器上生成Makefile时出错

在Ubuntu14.04上在交叉编译器上生成Makefile时出错
EN

Stack Overflow用户
提问于 2017-03-29 05:33:41
回答 1查看 424关注 0票数 0

我的电脑上使用的是qt5.5。我在做我的制作文件的时候遇到了问题。

我会通过发送这段代码得到Makefile。

代码语言:javascript
复制
qmake -spec ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/devices/linux-imx6-g++/ -o Makefile test.pro

这是没有问题的,但是当发送"make“来构建我的程序时,它会向我显示这个错误。

代码语言:javascript
复制
arm-poky-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=softfp -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/devices/linux-imx6-g++ -o main.o main.cpp
In file included from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui/qwindowdefs.h:37:0,
             from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/qwidget.h:37,
             from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/qmainwindow.h:37,
             from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/QMainWindow:1,
             from mainwindow.h:4,
             from main.cpp:1:
../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore/qglobal.h:39:21: fatal error: cstddef: No such file or directory
compilation terminated.
make: *** [main.o] Error 1

在另一种方法中,我也可以执行这个命令来获得Makefile。

代码语言:javascript
复制
qmake test.pro

在这种情况下,当我让我的Makefile做的很好。

但是,如果我使用-spec直接指向我想要的qmake.config,那么就会得到与上面类似的错误。

我不知道为什么会发生这种事。

我使用元工具链-qt5 5作为交叉编译器。

我错过了什么吗?或者是gcc版本太老的原因?

请帮帮忙!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-29 07:25:00

在使用由arm-poky-linux-gnueabi-g++构建的交叉编译器时,不应该直接调用OpenEmbedded。相反,您应该调用$CXX。原因是交叉编译器中内置的sysroot被毒害(它指向一个不存在的路径)。例如,请参见gcc报告sysroot是/不存在/不存在的中的解释。此更改是在YoctoProjectRelease1.8中引入的,请参阅默认Sysroot中毒

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43085121

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档