欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

【QT开发】S5P6818交叉移植QT4.8.6(编译)

程序员文章站 2022-06-08 22:03:38
...

(一)下载qt4.8.6源码

(二)配置编译平台

进入qt-everywhere-opensource-src-4.8.6/mkspecs/qws目录,新建arm-cortex_a9-linux-gnueabi-g++目录,复制linux-arm-g++目录下的所有文件到arm-cortex_a9-linux-gnueabi-g++

mkdir -parm-cortex_a9-linux-gnueabi-g++
cp –a linux-arm-g++/* arm-cortex_a9-linux-gnueabi-g++

(三)修改qmake.conf

进入arm-cortex_a9-linux-gnueabi-g++,修改文件qmake.conf

vi arm-cortex_a9-linux-gnueabi-g++/qmake.conf

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

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

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

# modifications to linux.conf
QMAKE_AR                = arm-cortex_a9-linux-gnueabi-ar cqs
QMAKE_OBJCOPY           = arm-cortex_a9-linux-gnueabi-objcopy
QMAKE_STRIP             = arm-cortex_a9-linux-gnueabi-strip

load(qt_config)

(四)生成Makefile

./configure --prefix=/usr/local/Qt4.8.6 -opensource -confirm-license -qt-sql-sqlite -qt-gfx-linuxfb -plugin-sql-sqlit -no-qt3support -no-phonon -no-svg -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-zlib -no-gif -qt-libtiff -qt-libpng -no-libmng -qt-libjpeg -no-rpath -no-pch -no-3dnow -no-avx -no-neon -no-openssl -no-nis -no-cups -no-dbus -embedded arm -platform linux-g++ -xplatform qws/arm-cortex_a9-linux-gnueabi-g++ -little-endian -qt-freetype -no-opengl -no-glib -nomake demos -nomake examples -nomake docs -nomake tools

(五)编译完成

注意在这里要处理一些问题

否则会出现这样的问题
Makefile:7037: recipe for target ‘.obj/release-shared-emb-arm/qabstractanimation.o’ failed
make[1]: *** [.obj/release-shared-emb-arm/qabstractanimation.o] Error 1
make[1]: Leaving directory ‘/home/chad/qt-everywhere-opensource-src-4.8.6/src/corelib’
Makefile:196: recipe for target ‘sub-corelib-make_default-ordered’ failed

修改 /src/corelib/io/io.pri 99行添加编译器
vi ./src/corelib/io/io.pri
修改前

【QT开发】S5P6818交叉移植QT4.8.6(编译)修改后
【QT开发】S5P6818交叉移植QT4.8.6(编译)

Make

Make install

编译和安装都没有出现错误

(六)配置一键编译

【QT开发】S5P6818交叉移植QT4.8.6(编译)【QT开发】S5P6818交叉移植QT4.8.6(编译)

相关标签: QT