如何在QtCreator上配置交叉编译工具链?

如何在QtCreator上配置交叉编译工具链?,qt,arm,cross-compiling,Qt,Arm,Cross Compiling,我已经使用Yocto构建了一个Qt工具链。我安装了它并设置了运行Yocto生成的脚本的环境变量 我打开QtCreator并遵循这些。 我无法构建此: #include <QApplication> #include <QPushButton> int main(int argc, char **argv) { QApplication a( argc, argv ); QPushButton hello( "Hello world!",

我已经使用Yocto构建了一个Qt工具链。我安装了它并设置了运行Yocto生成的脚本的环境变量

我打开QtCreator并遵循这些。 我无法构建此:

#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();    
}
因此,我尝试构建以下内容:

#include <stdio.h>

int main()
{
   printf("Hello world!\n");
   return 0;
}
还有一个警告可能非常具有指示性:

:-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,但结果是一样的。

解决了。也许我“撒谎”说手动设置mkspec也不起作用。那不是真的,是真的。只是我有另一个问题,无法正确测试。问题是
mkspec
它不正确。它指向的是
linux-g++
,我将它修复为指向正确的mkspec。不管怎么说,他告诉我他!那是虫子吗?这也解决了第一个问题(编译GUI)

我尝试用qmake从命令行编译,结果正确。因此,这是qt creator配置问题。如果手动运行qmake工作,那么您的工具包可能配置了错误的qmake如果我打开项目配置>构建>系统环境:设置环境脚本设置的变量就在那里。所以我不明白为什么它不工作。事实上,它是一个bug。已在4.3中固定:
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.