交叉编译Qt5.15.2,平台正点原子IMX6ULL

qmake.conf

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

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.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)

configure命令(全量编译,可以视情况裁剪):

./configure \
-prefix /disk/Data/Embed/IMX6ULL_ATK/qt/qt_bin \
-opensource \
-confirm-license \
-release \
-strip \
-shared \
--pkg-config \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-c++std c++11 \
--rpath=no \
-pch \
-make libs \
-make examples \
-nomake tools -nomake tests \
-gui \
-widgets \
-dbus-runtime \
--glib=no \
--iconv=no \
--pcre=qt \
--zlib=qt \
-no-openssl \
--freetype=qt \
--harfbuzz=qt \
-no-opengl \
-linuxfb \
--xcb=no \
-tslib \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \
-I/disk/Data/Embed/IMX6ULL_ATK/tslib/tslib_bin/include:/usr/include/c++/11.2.0 \
-L/disk/Data/Embed/IMX6ULL_ATK/tslib/tslib_bin/lib \
-recheck-all

代码修改,修改后才能正常编译:

diff -Naur qt5.15.2/qtbase/src/corelib/global/qendian.h qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qendian.h
--- qt5.15.2/qtbase/src/corelib/global/qendian.h	2020-10-27 16:02:11.000000000 +0800
+++ qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qendian.h	2022-03-12 17:30:02.189500917 +0800
@@ -44,6 +44,8 @@
 #include <QtCore/qfloat16.h>
 #include <QtCore/qglobal.h>

+#include <limits>
+
 // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
 #include <stdlib.h>
 #include <string.h>
diff -Naur qt5.15.2/qtbase/src/corelib/global/qfloat16.h qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qfloat16.h
--- qt5.15.2/qtbase/src/corelib/global/qfloat16.h	2020-10-27 16:02:11.000000000 +0800
+++ qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qfloat16.h	2022-03-12 17:30:22.206756327 +0800
@@ -44,6 +44,7 @@
 #include <QtCore/qglobal.h>
 #include <QtCore/qmetatype.h>
 #include <string.h>
+#include <limits>

diff -Naur qt5.15.2/qtbase/src/corelib/text/qbytearray.h qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearray.h
--- qt5.15.2/qtbase/src/corelib/text/qbytearray.h	2020-10-27 16:02:11.000000000 +0800
+++ qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearray.h	2022-03-12 17:31:26.788538547 +0800
@@ -51,6 +51,7 @@

 #include <string>
 #include <iterator>
+#include <limits>

 #ifdef truncate
 #error qbytearray.h must be included before any header file that defines truncate
diff -Naur qt5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h
--- qt5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h	2020-10-27 16:02:11.000000000 +0800
+++ qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h	2022-03-12 18:09:13.424697019 +0800
@@ -41,6 +41,7 @@
 #define QBYTEARRAYMATCHER_H

 #include <QtCore/qbytearray.h>
+#include <limits>

 QT_BEGIN_NAMESPACE

diff -Naur qt5.15.2/qtbase/src/corelib/time/qtimezoneprivate_p.h qt-everywhere-src-5.15.2/qtbase/src/corelib/time/qtimezoneprivate_p.h
--- qt5.15.2/qtbase/src/corelib/time/qtimezoneprivate_p.h	2020-10-27 16:02:11.000000000 +0800
+++ qt-everywhere-src-5.15.2/qtbase/src/corelib/time/qtimezoneprivate_p.h	2022-03-12 18:10:23.025485164 +0800
@@ -56,6 +56,8 @@
 #include "private/qlocale_p.h"
 #include "qvector.h"

+#include <limits>
+
 #if QT_CONFIG(icu)
 #include <unicode/ucal.h>
 #endif

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值