qt4.8.7交叉编译方法

1.修改mkspecs\linux-arm-gnueabi-g++下面的qmake.conf,修改成下面这样

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
TARGET_PLATFORM         = unix
TEMPLATE                = app
CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
QT                      += core gui
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-gcc
QMAKE_CXX               = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-g++
QMAKE_LINK              = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB        = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY           = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-objcopy
QMAKE_STRIP             = /usr/local/linaro-aarch64-2017.08-gcc7.1/bin/aarch64-linux-gnu-strip

load(qt_config)
 

其中aarch64-linux-gnu-g++是交叉编译工具

 

 

2   运行./configure \
-prefix ../arm-qt-output4.8 \
-xplatform linux-arm-gnueabi-g++ \
-qt-libpng \
-qt-libjpeg \
-force-pkg-config -opensource -confirm-license -no-qt3support -nomake demos -nomake examples -no-glib -depths 8,16,32 \
-qt-gfx-linuxfb -no-gfx-transformed -no-gfx-qvfb -no-gfx-vnc -no-gfx-multiscreen -no-gfx-directfb -no-mouse-pc \
-no-mouse-linuxtp -no-mouse-linuxinput -no-mouse-tslib -no-mouse-qvfb -no-kbd-tty -no-kbd-linuxinput -no-kbd-qvfb -release \
-static -little-endian -embedded generic -no-gif -no-libmng -no-accessibility -qt-zlib -qt-libjpeg -qt-libpng -no-libtiff \
-no-freetype -no-openssl -no-opengl -no-sql-sqlite -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon \
-no-phonon-backend -no-svg -no-webkit -no-script -no-scripttools -no-stl -no-declarative -no-pch -no-xinerama -no-cups \
-no-nis -no-separate-debug-info -fast -no-rpath

3.make and make install

亲测能编译通过

 

你可能感兴趣的:(qt4.8.7交叉编译方法)