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 下即可解决。