我尝试部署在PC上运行良好的QT应用程序。该应用程序部署在基于ASEM的yocto安装映像中,版本为“ morty”。
我收到错误消息“ qml:错误加载组件:qrc:/GUI/InputDialog.qml:3模块“ QtQuick.Controls” 2.0版未安装”
但是,我在LDD输出中看不到任何麻烦:
ldd $clientApp
linux-vdso.so.1 (0x7ed4b000)
libquazip.so.1 => /usr/lib/libquazip.so.1 (0x76f72000)
libQt5QuickWidgets.so.5 => /usr/lib/libQt5QuickWidgets.so.5 (0x76f64000)
libQt5Quick.so.5 => /usr/lib/libQt5Quick.so.5 (0x76c5e000)
libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x7674c000)
libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x762dd000)
libQt5Qml.so.5 => /usr/lib/libQt5Qml.so.5 (0x75f8d000)
libQt5Network.so.5 => /usr/lib/libQt5Network.so.5 (0x75e3d000)
libQt5Xml.so.5 => /usr/lib/libQt5Xml.so.5 (0x75e0d000)
libQt5Sql.so.5 => /usr/lib/libQt5Sql.so.5 (0x75dc1000)
libQt5Test.so.5 => /usr/lib/libQt5Test.so.5 (0x75d8c000)
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x75861000)
libpthread.so.0 => /lib/libpthread.so.0 (0x75839000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x756f3000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x756c7000)
libc.so.6 => /lib/libc.so.6 (0x7558b000)
libGLESv2.so.2 => /usr/lib/libGLESv2.so.2 (0x75492000)
libm.so.6 => /lib/libm.so.6 (0x75414000)
libz.so.1 => /lib/libz.so.1 (0x753f2000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x753ba000)
libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0x750e9000)
libdl.so.2 => /lib/libdl.so.2 (0x750d6000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x74fd7000)
librt.so.1 => /lib/librt.so.1 (0x74fc0000)
/lib/ld-linux-armhf.so.3 (0x76faa000)
libGAL.so => /usr/lib/libGAL.so (0x74ebc000)
libEGL.so.1 => /usr/lib/libEGL.so.1 (0x74e9d000)
libVSC.so => /usr/lib/libVSC.so (0x74ddb000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x74d8c000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x74d7a000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x74d66000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x74d48000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x74c2e000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x74c01000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x74bef000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x74bdb000)
qml代码中令人反感的行是:
import QtQuick.Controls 2.0
没有成功,我已经在配方中添加了以下代码:
+IMAGE_INSTALL_append = " qtquickcontrols"
目录/ usr / lib / qt5 / qml / QtQuick存在,并且包含libqtquick2plugin.so
在启动应用程序之前将此目录添加到LD_LIBRARY_PATH并不能解决问题。
我已导出: 导出LD_LIBRARY_PATH = / usr / lib / qt5 / qml / QtQuick.2:/ usr / lib / qt5 / qml / QtQuick
我想知道可能缺少什么文件。 可以请人提供如何调试此方法的指示吗?
为了测试Amfasis的想法,我现在还导出
export QML2_IMPORT_PATH =“ / usr / lib / qt5 / qml” 在同一外壳中启动应用程序之前。
ls /usr/lib/qt5/qml/
Qt
QtGraphicalEffects
QtLocation
QtPositioning
QtQml
QtQuick
QtQuick.2
QtTest
QtWebChannel
QtWebEngine
builtins.qmltypes
尽管如此,错误仍然存在。
好像我缺少libQt5QuickControls.so 我会深入探讨...
答案 0 :(得分:0)
供以后参考:
这个想法是在yocto中明确声明一个依赖项。
这可以通过添加
来实现 RDEPENDS_${PN} = "qtquickcontrols2 \
qtquickcontrols2-mkspecs \
"
然后,将编译并安装依赖项。
不过,添加以下内容(我之前已经拥有过)还不够:
DEPENDS = "qtquickcontrols2"