#linux qt gcc编译
前言
下载gcc交叉工具编译链 。
下载qt-everywhere-src-5.12.9.tar.xz
wget http://download.qt.io/official_releases/qt/5.12/5.12.9/single/qt-everywhere-src-5.12.9.tar.xz
下载qt-opensource-windows-x86-5.12.9
一、安装gedit
sudo apt-get install gedit
二、安装依赖库
sudo apt-get update
sudo apt-get install mesa-utils
installing the libclang-dev or libclang-devel package
sudo apt-get install libgles2-mesa-dev
sudo apt-get install gdb
sudo apt-get install libncurses5
sudo apt-get install python2.7
sudo apt-get install gdb-multiarch
三、安装交叉编译工具
cd /opt
sudo tar -xvf /mnt/hgfs/share/a40-toolchain-gnueabihf.tar
sudo gedit /etc/prfile
在最后加上
export PATH=$PATH:/opt/a40-toolchain-gnueabihf/external-toolchain-gnueabihf/bin
linux重启生效
验证:arm-linxu-gnueabihf-gcc -v 看是否正确
四、编译qt-everywhere-src-5.12.9
cd /opt
sudo tar -xvf /mnt/hgfs/share/qt-everywhere-src-5.12.9.tar.xz
cd qt-everywhere-src-5.12.9
cd qtbase/mkspecs/linux-arm-gnueabi-g++/
sudo gedit qmake.conf
全都改成绝对路径
cd /opt
cd qt-everywhere-src-5.12.9
sudo gedit auto.sh
./configure -prefix /opt/dtu/qt
-opensource
-confirm-license
-release
-make libs
-xplatform linux-arm-gnueabi-g++
-optimized-qmake
-pch
-skip qt3d
-skip qtcanvas3d
-skip qtdeclarative
-skip qtdoc
-skip qtlocation
-skip qtmacextras
-skip qtnetworkauth
-skip qtpurchasing
-skip qtremoteobjects
-skip qtscript
-skip qtscxml
-skip qtsensors
-skip qtspeech
-skip qtsvg
-skip qttools
-skip qttranslations
-skip qtwayland
-skip qtwebengine
-skip qtwebchannel
-skip qtwinextras
-skip qtx11extras
-skip qtxmlpatterns
-no-opengl
-no-sse2
-no-openssl
-no-cups
-no-glib
-no-iconv
-no-pkg-config
-nomake examples
-nomake tests
sudo chmod 777 auto.sh
sudo ./auto.sh
make
make install
五、安装qt
sudo ./qt-opensource-windows-x86-5.12.9
六、配置qt
QT Version,add按钮
Compliers,g++,add按钮
Compliers,gcc,add按钮