0.1 准备
(1) 安装交叉编译链,我使用的为:arm-linux-gnueabihf-gcc
(2) 交叉编译tslib,我使用的为厂家编译好的tslib,如果使用电阻式触摸屏必须使用tslib。
(3) 下载Qt5.7源码包
http://download.qt.io/official_releases/qt/5.7/5.7.0/submodules/qt-everywhere-opensource-src-5.7.0.tar.gz
1.1 安装Qtcreator
(1) 下载地址
http://mirrors.ustc.edu.cn/qtproject/archive/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run
(2) 以root身份运行安装程序,并安装到合适的目录(/opt或/usr/local)
1.2 解压
tar -zxvf /home/chy/qianRuShi/ziliao/qt/qt-everywhere-opensource-src-5.7.0.tar.gz -C /opt/Qt5.8.0/5.8/
1.3 拷贝编译器配置文件
cp ./qtbase/mkspecs/linux-arm-gnueabi-g++ ./qtbase/mkspecs/linux-arm-gnueabihf-g++ -r
1.4 修改qmake.conf
vim ./qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf
内容如下:
图一
1.5 配置并生成Makefile
./configure -prefix /opt/Qt5.8.0/5.8/Qt5.7_arm_linuxfs/ -opensource -shared -xplatform linux-arm-gnueabihf-g++ -qt-zlib -tslib -no-opengl -nomake examples -skip qtcanvas3d -I/opt/tslib/include -L/opt/tslib/lib -skip qt3d -qreal float -qt-libpng -qt-libjpeg -make libs -skip qtdeclarative
1.6 模块清单
Configure summary
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: linux-arm-gnueabihf-g++ (arm, CPU features: none detected)
Platform notes:
- Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
Build options:
Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus doubleconversion enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config largefile