由于工作的需要,需要在x86 ubuntu下开发arm qt程序,分以下几步:
一、首先交叉编译QT
1、下载qt源码 地址 qt下载地址 然后解压:tar -Jxvf qt-everywhere-src-5.12.10.tar.xz
2、配置交叉链,把交叉链export 到路径中
export PATH=$PATH:/home/calvin/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin
3、因为是arm64平台,交叉链也是aarch64的,所以
cd $QTSRC/qtbase/mkspecs/linux-aarch64-gnu-g++/
vim qmake.conf
把里面的交叉链修改成自己的
4、./configure -prefix $PWD/qtbase -opensource -xplatform linux-aarch64-gnu-g++ -no-opengl -nomake examples
5、make -j8
编译的文件在qtbase目录下面
二、配置QT Creator
1、选项--》构建/生成;先配置编译器,指定到自己的交叉链bin目录
2、配置qmake,指定到上面生成的qtbase目录
3、配置kits