【瑞芯微】【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
相关推荐
上去我就QWER2 小时前
深入解析Qt中的QDrag:实现灵活的拖放交互
c++·qt
A.A呐6 小时前
【QT第三章】常用控件1
开发语言·c++·笔记·qt
CodeKwang9 小时前
Qt实战:自定义搜索跳转控件 | 附完整源码
qt·qt控件
努力还债的学术吗喽9 小时前
【项目】pyqt5基于python的照片整蛊项目
开发语言·python·qt
weixin_459548909 小时前
Qt对话框设计
qt
QT 小鲜肉18 小时前
【QT/C++】Qt定时器QTimer类的实现方法详解(超详细)
开发语言·数据库·c++·笔记·qt·学习
MeowKnight95818 小时前
【Qt】Qt实践记录3——UDP通信
笔记·qt
扶尔魔ocy1 天前
【QT自定义2D控件】QGraphics绘制仪表盘
数据库·qt·microsoft
开心-开心急了1 天前
关于Flutter与Qt for python 的一些技术、开源、商用等问题
开发语言·python·qt·flutter