【瑞芯微】【rk3128】【移植 qt 5.12.9】

一、移植 QT 5.12.9

1. 源码下载

qt5.12.9源码下载

2. 配置 QT

进入 rk3128 docker 环境

复制代码
./rk3128_docker_env/init.sh
c 复制代码
进入已存在的开发环境...
my_rk3128_dev
developer@c8aa26115a95:/workspace$ vim /home/developer/.bashrc 
c 复制代码
ARM_BIN_PATH=/workspace/RK3128/buildroot/output/rockchip_rk312x/host/bin
export PATH=$ARM_BIN_PATH:$PATH
c 复制代码
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ vim qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf


MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

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

# modifications to g++.conf  修改为 buildroot 里面的 交叉工具链
QMAKE_CC                = arm-buildroot-linux-gnueabihf-gcc
QMAKE_CXX               = arm-buildroot-linux-gnueabihf-g++
QMAKE_LINK              = arm-buildroot-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-buildroot-linux-gnueabihf-g++

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

进入qt-everywhere-src-5.12.9文件夹下 配置一个编辑文件 名字可以自己命名

shell 复制代码
cd qt-everywhere-src-5.12.9
gedit autoconfigure.sh
c 复制代码
./configure -prefix /workspace/qt-everywhere-src-5.12.9/arm-qt \
-opensource \
-confirm-license \
-release \
-strip \
-shared \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-c++std c++11 \
--rpath=no \
-pch \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtspeech \
-skip qtsvg \
-skip qttools \
-skip qttranslations \
-skip qtwayland \
-skip qtwebengine \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-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 \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \
-recheck-all
c 复制代码
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ ./autoconfigure.sh



Note: Also available for Linux: linux-clang linux-icc

Note: -optimized-tools is not useful in -release mode.

WARNING: Cross compiling without sysroot. Disabling pkg-config

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/workspace/qt-everywhere-src-5.12.9/arm-qt'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

3. 编译安装

c 复制代码
# 直接在 当前目录执行

make

make install  # 最终将 编译后的 QT 生成到 /workspace/qt-everywhere-src-5.12.9/arm-qt 目录下

4. 放到板子里

将上面编译出来的 arm-qt 放到我们的板子里面就可以了

c 复制代码
cp -r arm-qt/ /usr/lib/

在板子里面更新环境变量

c 复制代码
vi /etc/profile

export QT_ROOT=/usr/lib/arm-qt
export QT_QPA_FONTDIR=/usr/share/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_PLUGIN_PATH=$QT_ROOT/plugins
export LD_LIBRARY_PATH=$QT_ROOT/lib:$QT_ROOT/plugins/platforms
export QML2_IMPORT_PATH=$QT_ROOT/qml
export QT_QPA_FB_TSLIB=1
相关推荐
m0_7263658318 小时前
哈希分分预测系统 打造自适应趋势分析「Python+DeepSeek+PyQt5」
python·qt·哈希算法
new_zhou19 小时前
vs2019+qt工程中生成dump文件及调试
开发语言·qt·visual studio·dump调试
hqwest20 小时前
码上通QT实战16--监控页面08-连接后状态处理
qt·串口·信号与槽·serialport·通信过程·打开串口·com1
hqwest1 天前
码上通QT实战15--监控页面07-打开串口连接
开发语言·qt·多线程·signal·slot·emit·信号和槽
CS Beginner1 天前
【单片机】嵌入式显示屏开发框架:QT、SDL、LVGL 深度解析
单片机·嵌入式硬件·qt
金色熊族1 天前
MV结构下设置Qt表格的代理(2)
c++·qt
Morwit1 天前
Qt qml创建c++类的单例对象
开发语言·c++·qt
YxVoyager1 天前
Qt C++ :QRegularExpression 正则表达式使用详解
c++·qt·正则表达式
qq_401700411 天前
QStackedLayout 实现遮罩层
qt
Larry_Yanan1 天前
Qt多进程(十一)Linux下socket通信
linux·开发语言·c++·qt