在 Ubuntu 14.04 的交叉编译器上制作 Makefile 时出错
error while make the Makefile on cross compiler on Ubuntu 14.04
我在我的电脑上使用 qt5.5。 我在制作 Makefile 时遇到了问题。
我将通过发送此代码获得 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,则会出现上述错误。
不知道为什么会这样
我正在为我的交叉编译器使用 meta-toolchain-qt5。
我是不是遗漏了什么或者是 gcc 版本太旧的原因?
请帮忙!
使用 OpenEmbedded 构建的交叉编译器时,切勿直接调用 arm-poky-linux-gnueabi-g++
。相反,您应该调用 $CXX
。原因是交叉编译器内置的sysroot中毒了(指向不存在的路径)。例如参见 [=12=].