安装qt包
1、下载http://download.qt.io/archive/qt/5.11/5.11.2/single/qt-everywhere-src-5.11.2.tar.xz
安装指南:http://doc.qt.io/qt-5/build-sources.html
sudo apt-get install
bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev
libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev
libpulse-dev libudev-dev libxtst-dev gyp ninja-build libglu1-mesa-dev libfontconfig1-dev
libx11-xcb-dev libicu-dev
2、解压xz -d qt-everywhere-src-5.11.2.tar.xz
3、tar -xvf qt-everywhere-src-5.11.2.tar
4、sudo apt-get install automake libtool
5、sudo apt install g++-arm-linux-gnueabi
6、下载https://github.com/kergoth/tslib
配置tslib
./autogen.sh
./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --prefix=/home/lonnox/work/tools/tslib --host=arm-linux ac_cv_func_malloc_0_nonnull=yes
make
make install
7交叉编译QT库
vim auto-configure-imx6.sh
#!/bin/sh
./configure \
-v \
-opensource \
-confirm-license \
-release \
-prefix /home/lonnox/work/tools/qt-arm2 \
-device linux-imx6-g++ \
-device-option CROSS_COMPILE=/home/lonnox/work/tools/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
-sysroot /home/lonnox/work/tools/sysroot-glibc-linaro-2.25-2018.05-arm-linux-gnueabihf \
-qt-libpng \
-qt-libjpeg \
-linuxfb \
-no-opengl \
-no-pkg-config \
-nomake examples \
-tslib \
-I/home/lonnox/work/tools/tslib/include \
-L/home/lonnox/work/tools/tslib/lib \
-no-iconv
#-no-feature-accessibility
chmod +777 autoConfigure_imx6.sh
sudo ./autoConfigure_imx6.sh
sudo make
sudo make install
export QTDIR=/opt/qt4.8.5
export PATH=QTDIR/bin:QTDIR/bin:PATH
export LD_LIBRARY_PATH=QTDIR/lib:QTDIR/lib:LD_LIBRARY_PATH
export QT_PLUGIN_PATH=QTDIR/pluginsexportQTQWSFONTDIR=QTDIR/pluginsexportQTQWSFONTDIR=QTDIR/lib/fonts
export QWS_MOUSE_PROTO=tslib:/dev/input/event2
export QWS_DISPLAY=”linuxfb:mmWidth50:mmHeight130:0”
export QWS_SIZE=800x480