我已經使用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