this is my first time when I use Yocto and I want to create an image for Raspberry Pi 4 of a Qt Qml application, but I got the following error :
ERROR: mytest1-0.1-r0 do_configure: Error calling /home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/recipe-sysroot-native/usr/bin/qmake -makefile -o Makefile -r /home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/untitled.pro -- ERROR: mytest1-0.1-r0 do_configure: Execution of '/home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/temp/run.do_configure.72533' failed with exit code 1 ERROR: Logfile of failure stored in: /home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/temp/log.do_configure.72533
This is the build configuration
And I tried to run locally using that qmake and i got this:
Should I change the version of Qt to and older version like 5.12 or the problem is another one?
This is following warnings of the errors:
Log data follows: | DEBUG: Executing shell function qmake5_base_preconfigure | DEBUG: Shell function qmake5_base_preconfigure finished | DEBUG: Executing shell function do_configure | Project ERROR: Unknown module(s) in QT: quick | ERROR: Error calling /home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/recipe-sysroot-native/usr/bin/qmake -makefile -o Makefile -r /home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/untitled.pro -- | WARNING: exit code 1 from a shell command. | ERROR: Execution of '/home/dragos/workspace/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mytest1/0.1-r0/temp/run.do_configure.78253' failed with exit code 1 ERROR: Task (/home/dragos/workspace/poky/meta-test1/recipes-test1/mytest1/mytest1_0.1.bb:do_configure) failed with exit code '1'
And this is my .bb file:
SUMMARY = "This is my test app"
DESCRIPTION = "Test for qml app"
LICENSE = "CLOSED"
SRC_URI = "file://direction.png \
file://main.cpp \
file://main.qml \
file://qml.qrc \
file://untitled.pro \
"
S = "${WORKDIR}"
inherit qmake5
do_install_append() {
echo "installing"
install -d ${D}${bindir}
install -m 0755 ${S}/myapp ${D}${bindir}
install -d ${D}${datadir}/myapp
install -m 0644 ${S}/qml/* ${D}${datadir}/myapp
}
DEPENDS += "qtbase"
RDEPENDS_${PN} += "qtwayland"
FILES_${PN} += "${bindir}/myapp \
${datadir}/myapp/*"
main.cpp file
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
return app.exec();
}
main.qml file
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 640
height: 480
color: "#452896"
title: qsTr("Hello World")
property var vl: 0
Rectangle{
width: 200
height: 200*vl
anchors.centerIn: parent
color: "red"
Behavior on height {
NumberAnimation{
duration: 1000
easing.type: "Linear"
}
}
}
Timer{
interval: 1000
repeat: true
running: true
onTriggered: {
vl = Math.random(100)
console.log(vl)
}
}
Image {
id: img
source: "direction.png"
width: 40
height: 40
}
}
qml.qrc file
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>direction.png</file>
</qresource>
</RCC>
untitled.pro file
QT += quick
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp
RESOURCES += qml.qrc
QML_INSTALL_DIR = /qml
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = /qml
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
Suplimentary lines added in local.conf:
MACHINE = "raspberrypi4"
DISTRO = "poky"
IMAGE_INSTALL_append += " mytest1 "
DISTRO_FEATURES_append += " wayland "
IMAGE_INSTALL_append += "qtbase qtwayland qtbase-dev qtbase-mkspecs qtbase-tools"
CORE_IMAGE_EXTRA_INSTALL += "wayland weston "
IMAGE_INSTALL += "tslib"
ENABLE_UART = "1"