我的电脑上使用的是qt5.5。我在做我的制作文件的时候遇到了问题。
我会通过发送这段代码得到Makefile。
qmake -spec ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/devices/linux-imx6-g++/ -o Makefile test.pro这是没有问题的,但是当发送"make“来构建我的程序时,它会向我显示这个错误。
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。
qmake test.pro在这种情况下,当我让我的Makefile做的很好。
但是,如果我使用-spec直接指向我想要的qmake.config,那么就会得到与上面类似的错误。
我不知道为什么会发生这种事。
我使用元工具链-qt5 5作为交叉编译器。
我错过了什么吗?或者是gcc版本太老的原因?
请帮帮忙!
发布于 2017-03-29 07:25:00
在使用由arm-poky-linux-gnueabi-g++构建的交叉编译器时,不应该直接调用OpenEmbedded。相反,您应该调用$CXX。原因是交叉编译器中内置的sysroot被毒害(它指向一个不存在的路径)。例如,请参见gcc报告sysroot是/不存在/不存在的中的解释。此更改是在YoctoProjectRelease1.8中引入的,请参阅默认Sysroot中毒。
https://stackoverflow.com/questions/43085121
复制相似问题