Linux の Qt クロスコンパイル

ソフトウェアバージョン

クロスコンパイル ツール チェーン: gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
Qt バージョン: qt-everywhere-src-5.12.9.tar.xz
Ubuntu バージョン: ubuntu-22.04。 2 -デスクトップ-amd64.iso

解凍ディレクトリ

/home/qsqya/compile/qt5.12.9/qt-everywhere-src-5.12.9
/opt/arm-none-linux-gnueabihf-9.2

環境構成

  1. コマンド ライン ウィンドウを開き、環境変数 (一時的) を構成します。
export PATH=/opt/arm-none-linux-gnueabihf-9.2/bin:$PATH
  1. 構成ファイル
    /home/qsqya/compile/qt5.12.9/qt-everywhere-src-5.12.9/qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.confを変更し
    、次の内容を置き換えます。
:%s#arm-linux-gnueabi#arm-none-linux-gnueabihf#g
  1. コンパイル スクリプト
    /home/qsqya/compile/qt5.12.9/compile.shを作成します。
#!/bin/sh

cd ./qt-everywhere-src-5.12.9

./configure -prefix /home/qsqya/compile/qt5.12.9/build \
-opensource \
-release \
-confirm-license \
-xplatform linux-arm-gnueabi-g++ \
-shared \
-nomake examples \
-nomake tests \
-no-opengl

自分でパスを変更する
4. スクリプトを実行する

./compile.sh
make -j 4         ##编译
make install      ##安装

質問

  • エラーメッセージ(5.9.9)
3:38: error: ‘numeric_limits’ is not a member of ‘std’
  103 |         const auto uchar_max = (std::numeric_limits<uchar>::max)();

解決:

qtbase/src/corelib/tools/qbytearraymatcher.h
#include <QtCore/qbytearray.h>
+#include <limits>

  • エラーメッセージ
/home/qsqya/compile/qt5.12.9/qt-everywhere-src-5.12.9/qtbase/include/QtCore/../../src/corelib/global/qendian.h:331:35: error: ‘numeric_limits’ is not a member of ‘std’
  331 |     {
    
     return QSpecialInteger(std::numeric_limits<T>::max()); }

解決

#include <QtCore/qfloat16.h>
#include <QtCore/qglobal.h>
+#include <limits>
  • エラーメッセージ
/home/qsqya/compile/qt5.12.9/qt-everywhere-src-5.12.9/qtbase/src/corelib/tools/qbytearraymatcher.h:103:38: error: ‘numeric_limits’ is not a member of ‘std’
  103 |         const auto uchar_max = (std::numeric_limits<uchar>::max)();

解決

#include <QtCore/qbytearray.h>
+#include <limits>
  • エラー メッセージ、作成フェーズ中に報告されたエラー
/home/qsqya/compile/qt5.12.9/qt-everywhere-src-5.12.9/qtbase/src/corelib/kernel

解決

#include <QtCore/qobject.h>
#ifndef QT_BOOTSTRAPPED
#include <QtCore/qbytearraylist.h>
#endif
+#include <limits>

おすすめ

転載: blog.csdn.net/qq_39049011/article/details/130095213