Qt5.14.2交叉编译(含tslib)

操作系统:deepin15.11

编译器:arm-linux-gnueabihf-gcc

Qt库版本:5.14.2

源码:qt-everywhere-src-5.14.2.tar.xz

tslib交叉编译点这里

步骤:

1、解压qt-everywhere-src-5.14.2.tar.xz

2、修改源码中qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf 文件

将里面的编译器改成我们使用的编译器,如下:

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_NM                = arm-linux-gnueabihf-nm -P
QMAKE_STRIP             = arm-linux-gnueabihf-strip
load(qt_config)

3、配置,执行下面的命令(静态编译、release版本)

./configure -prefix /opt/Qt5.14.2/5.14.2/arm-linux -static -release -opensource -make libs -xplatform linux-arm-gnueabi-g++ -optimized-qmake -pch -qt-libjpeg -qt-zlib -no-opengl -skip qt3d -skip qtcanvas3d -skip qtpurchasing -no-sse2 -no-openssl -no-cups -no-glib -no-iconv -nomake examples -tslib -I /opt/tslib1.21/include -L /opt/tslib1.21/lib

-prefix后跟交叉编译后的Qt库的位置

-static表示静态编译

-release表示release版本

-tslib:包含tslib,如不需要可去掉

-I /opt/tslib1.21/include:tslib头文件位置

-L /opt/tslib1.21/lib:tslib库文件位置

4、make -j4(-j4表示使用4个线程)

5、 make install

你可能感兴趣的:(Qt5.14.2交叉编译(含tslib))