首页 > 代码库 > module "QtQuick" is not installed

module "QtQuick" is not installed

  今天在项目上将之前rootfs上关于qt的目录由原来的usr/lib/qt5/变为/usr/local/qt5.2.1和/usr/local/qt5.6.2,由于webApp和HMI的进程用的不同的Qt版本(HMI使用的是Qt5.6.2),所以项目上将两套Qt的路径分开了。在启动HMI进程发现qtapp(HMI进行)成功启动,但是出现如下错误:

qrc:/root.qml:11:1: module "QtQuick" is not installed

    后来怀疑是环境变量配置上出了问题,但是看下面的好像也没有问题啊 

QTDIR=/usr/local/qt5.6.2 
export PATH=/usr/local/sbin:$PATH
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$QTDIR:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/app/NativeApps/sys/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/lib/gstreamer-1.0/:$LD_LIBRARY_PATH

export QT_QPA_PLATFORM=eglfs
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins
export QT_QPA_FONTDIR=/usr/lib/fonts
export QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/event0

  HMI该导入的环境变量到导入了,plugins也导入了,于是用strace跟踪了下,打开的也都是/usr/local/qt5.6.2 路劲下面的东西,那问题出在哪里,最后查了下,加上:

export QML2_IMPORT_PATH=$QTDIR/qml

竟然ok了,原因请教了下BSP的工程师(因为rootfs使他们配置的),他们说是因为QtQuick之前有默认的usr/lib/qt5/qml/下面去找QtQuick相关的路径,现在目录变为/usr/local/qt5.6.2,必须显示的设置下才可以,不然找不到QtQuick,所以出现

qrc:/root.qml:11:1: module "QtQuick" is not installed

这个解释正确不正确还有待确定,暂时认为是正确的吧。

 

  

    

 

module "QtQuick" is not installed