我已经使用Yocto构建了一个Qt工具链。我安装了它并设置了运行由Yocto生成的脚本的环境变量。如何在QtCreator上配置交叉编译工具链?
我打开QtCreator并按照这些instructions打开configure my cross-compiler kit。 我无法建立这样的:
#include <QApplication>
#include <QPushButton>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QPushButton hello("Hello world!", 0);
hello.resize(100, 30);
hello.show();
return a.exec();
}
收到此错误:
(.qtversion[qt_version_tag]+0x0):-1: error: undefined reference to `qt_version_tag'
所以我尝试建立这个代替:
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
这没关系。但是,当我部署到我的目标并尝试运行时,它不能,因为它尚未针对目标架构(arm)进行编译。
helloworld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ldd
也有这个警告可能是非常指示:
:-1: warning: "/usr/bin/gcc" is used by qmake, but "/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc" is configured in the kit.
Please update your kit or choose a mkspec for qmake that matches your target environment better.
我试图设置mkspec我的包的配置,但结果是一样的。
我试图从命令行与qmake编译,它没有错。所以这是qt创建者配置问题。 – anat0lius
如果手动运行qmake工作,那么你的套件可能配置了错误的qmake –
如果我打开项目配置>构建>系统环境:由setup-enviornment脚本设置的变量在那里。所以我不明白为什么它不起作用。 – anat0lius