RK3588 Qt 交叉编译之四:配置及编译报错记录
运行时出现错误提示:
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
原因是缺少 iconv 库,解决方案如下:./configure
后添加编译-no-iconv
运行时出现错误提示:
Unable to figure out framebuffer device. Specify it manually.
linuxfb: Failed to initialize screen
no screens available, assuming 24-bit color
原因发现是 RK3588 没有 fb,所以不支持 LinuxFB 平台插件。
#error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
./configure
之后在 config.log 中查找的错误,网上找了下,未找到解决办法,故未解决,也不影响交叉编译成功。
ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
ERROR: Feature 'egl' was enabled, but the pre-condition '(features.opengl || features.openvg) && (features.angle || libs.egl)' failed.
ERROR: Feature 'eglfs' was enabled, but the pre-condition '!config.android && !config.darwin && !config.win32 && features.egl' failed.
需要先配置 EGL 和 OPENGL ES2 的 include 和 lib 路径才能正常编译。需要修改 qmake.conf:
# tell configure where to find opengl_es2
QMAKE_INCDIR_OPENGL_ES2 = /home/***/work/target/usr/include
QMAKE_LIBDIR_OPENGL_ES2 = /usr/aarch64-linux-gnu
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 -lmali
# tell configure where to find egl
QMAKE_INCDIR_EGL = /home/***/work/target/usr/include
QMAKE_LIBDIR_EGL = /usr/aarch64-linux-gnu
QMAKE_LIBS_EGL = -lEGL -lGLESv2 -lmali
gcc 编译程序错误: as: unrecognized option ‘--64‘
解决方案:gcc 编译程序错误: as: unrecognized option ‘--64‘
使用kms_mali插件,运行会报错,打开 export QT_DEBUG_PLUGINS=1
,报错如下:
QFactoryLoader::QFactoryLoader() checking directory path "/opt/demo/egldeviceintegrations" ...
loaded library "/opt/qt5122_rk3588_eglfs_mali/plugins/egldeviceintegrations/libqeglfs-mali-integration.so"
Failed to open fb to detect screen resolution!
Could not get variable screen info
Unable to set double buffer mode! (Bad file descriptor)
arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '5'.
提示 eglfs_mali 依赖 fb。
undefined symbol: gbm create device
拷贝了一个正常的libmali.so libmali.so.1到/usr/lib才解决:undefined symbol: gbm create device
> /usr/bin/ld.gold: fatal error: verifyspec.o: unsupported ELF machine number 183
> collect2: error: ld returned 1 exit status
> Makefile:68: recipe for target 'verifyspec' failed
> make: *** [verifyspec] Error 1
Note: Also available for Linux: linux-clang linux-icc
ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
只能换个 Ubuntu 虚拟机来交叉编译,可能是原主机的环境有问题,暂时没能彻底解决。
qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_kms"
解决:将 eglfs_kvm 改为 eglfs_none
undefined symbol: gbm create device
arm_release_ver of this libmali is 'g2po-01eac0',rk_so_ver is 6'.
Fai1ed creating base context during opening of kerneT driver.
Kerne1 module may not have been loaded
could not initiaiize egl display
上面两个报错,都是由于给的 libmali.so.1 库不对,将提供的 deps 目录下的 libmali.so、libmali.so.1 拷贝到 /usr/lib 下即可解决。
分类:
Qt Embedded
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!