基于RK3399的arm64-Linux操作系统 QT开发笔记

交叉编译器qt源码:

参考这篇博客,写的挺全的:https://blog.csdn.net/dieju8330/article/details/86568144

我使用的是5.9.7版本的qt源码。

我使用的交叉编译器版本是aarch-linux-gnu- 7.5.0。
在这里插入图片描述

在这里插入图片描述
需要注意的是mkspecs文件夹中已经有了Linux-aarch64-gnu-g++的qmake.conf配置文件,所以我没有对这部分做更改。
在这里插入图片描述
最后得到的SDK。
最后遇到的问题:测试的时候报错:

QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.

解决办法:将开发板根文件系统里的/usr/share/fonts移到sdk/lib文件夹下。

然后 sudo vi /etc/profile

export QTDIR=/home/tgm/qt/qt_sdk  #这里改成自己qt-sdk源码的路径
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
export QWS_MOUSE_PROTO=/dev/input/event0
export QT_QPA_FONTDIR=$QTDIR/lib/fonts/truetype/dejavu

然后 source /etc/profile

我的根文件系统如下:
在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐