2016-05-25 48 views
0

我正在使用Yocto在嵌入式主板(i.MX6)上執行Qt和QtWebEngine的第一步。使用提供的示例食譜,如quicknanobrowser,在目標上很好地工作。所以我無法確認this answer哪個聲稱WebEngine在嵌入式平臺上不可用。Yocto SDK,QtWebEngine:QT中的未知模塊:webengine

現在我想編寫自己的QML應用程序並將其部署到電路板上。配方meta-toolchain-qt5我創建了一個SDK並安裝它。在QtCreator我將所有路徑的SDK安裝,並試圖構建它,但得到這個錯誤:

Project ERROR: Unknown module(s) in QT: webengine 
11:13:13: The process "/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake" exited with code 3. 

原來WebEngine不包括在SDK中。由於this answer,我固定的投入由以下我自己packagegroup-qt5-toolchain-target.bbappend文件:

RDEPENDS_${PN} += " \ 
    qtwebengine \ 
    qtwebengine-qmlplugins \ 
    qtquickcontrols-qmlplugins \ 
    qtwebengine-examples \ 
" 

然後重新安裝SDK。目前看來,所有WebEngine文件可在SDK安裝用(zsh glob模式下面匹配的/opt/poky/1.8/任何子目錄中的所有目錄,其中包含「webengine」,不區分大小寫):

% ls -1 -d (#i)/opt/poky/1.8/**/*webengine*(/) 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngine/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngine/5.4.3/QtWebEngine/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngineWidgets/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngineWidgets/5.4.3/QtWebEngineWidgets/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/qml/QtWebEngine/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/examples/webengine/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/examples/webenginewidgets/ 
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/translations/qtwebengine_locales/ 

不過,我得到相同未知模塊錯誤。這是獨立QtCreator的,也可以通過直接調用QMAKE所示:

% source /opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi 
% /opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake /home/me/test/test.pro -r -spec linux-oe-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug 
Project ERROR: Unknown module(s) in QT: webengine 

項目本身應該沒有問題,因爲它編譯並沒有在桌面上安裝運行流暢。

任何想法? SDK中是否還有一些文件丟失? qmake在哪裏搜索模塊?我該如何告訴qmake在哪裏可以找到WebEngine安裝?

回答

0

/opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

添加sh /opt/poky/1.8/sysroots/x86_64-pokysdk-linux/environment-setup.d/qt5.sh

這將設置QT5環境。

+0

感謝您的回答!然而,這個文件已經在'/ opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi'中找到了。因此添加它或者甚至手動採集它並沒有幫助。 –

+1

嘗試關注此維基設置Qt創建者http://wiki.hioproject.org/index.php?title=HIO_Wiki:Set_Up_Qt_Creator_for_Yocto_Device –