YOCTO/QT5.6:无法构建示例QT应用程序



我有一个工作的氮6x板,该板在yocto krogoth-next build build with core core-image-sato上运行。我已经安装了QT Creator 3.5.1(基于QT 5.5.1),并且根据[Build&安装QT5工具链]文档。我添加了一个示例QT快速应用程序,其中选择了QT Quick 2.1的组件集并尝试编译源,我注意到以下错误。

19:04:25: Running steps for project untitled6...
19:04:25: Starting: "/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/qmake" /home/test/untitled6/untitled6.pro -r -spec linux-g++
19:04:25: The process "/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/qmake" exited normally.
19:04:25: Starting: "/usr/bin/make" 
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../untitled6 -I. -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o main.o ../untitled6/main.cpp
/opt/poky/2.1.1/sysroots/i686-pokysdk-linux/usr/bin/qt5/rcc -name qml ../untitled6/qml.qrc -o qrc_qml.cpp
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../untitled6 -I. -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o qrc_qml.o qrc_qml.cpp
g++ -Wl,-O1 -o untitled6 main.o qrc_qml.o   -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread 
/usr/bin/ld: cannot find -lQt5Quick
/usr/bin/ld: cannot find -lQt5Gui
/usr/bin/ld: cannot find -lQt5Qml
/usr/bin/ld: cannot find -lQt5Network
/usr/bin/ld: cannot find -lQt5Core
/usr/bin/ld: cannot find -lGLESv2
collect2: ld returned 1 exit status
make: *** [untitled6] Error 1
19:04:26: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled6 (kit: Nitrogen)
When executing step 'Make'
19:04:26: Elapsed time: 00:01.

所有QT库都存在于/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/下,我已经在套件下正确设置了SYSROOT路径,但是我无法弄清楚为什么我的应用程序未能参考这些库。对此的任何帮助将不胜感激。提前致谢。

MKSPEC指向您的套件指向的MKSPEC似乎是错误的(linux-g++),引用了您的构建日志

-I/opt/poky/2.1.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++

在为氮6x构建时,可能是linux-oe-g++。默认情况下,在您选择的QT版本中设置,也可以通过修改套件本身(QTCreator的选项)设置,在" Mkspec"下。

您看到的错误可能是由于Abi&指向的库的架构与您编译的X86/64代码不兼容。

还请确保在启动QTCreator之前启动Yocto的环境文件,如果遇到问题(即找不到有关" C"的错误错误)。这将设置通往交叉补偿器的路径。示例:

source /opt/poky/1.6.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
~/Qt/Tools/QtCreator/bin/qtcreator

相关内容

  • 没有找到相关文章

最新更新