Forum > QT
Yocto Recipe for libQt5Pas
BasePointer:
Hi,
I have a board from Toradex which runs custom Yocto build Linux on a iMX8M-Plus processor. (aarch64)
I use their tdx-reference-multimedia-image which has Graphics stack: Weston / Wayland + XWayland and Graphical User Interface framework: Qt5 and it runs Qt5 applications nicely.
What I want is to run Lazarus Application uses Qt5 widgetset.
First, I followed instructions here: https://developer.toradex.com/knowledge-base/lazarus and installed Lazarus v2.3.0 on my Win10 machine with cross compilers.
Then, I created a simple LCL Form app, add a simple button to say hello when it is pressed. Then I set the WidgetType to Qt5 and Target: Linux and CPU: aarch64. It is compiled and project1 executable created.
I copied it to the Toradex board and when I run of course I got a lot of library missing error. So far expected..
Luckily I found all required libraries as compiled under Lazarus\cross\lib\aarch64-linux folder but sure it would be too easy if all they worked :) They created a lot of incompatibilities and embedded system Linux crashed eventually.
So I decided to add each library required by Lazarus app into Toradex Yocto Image so that they can be compiled fully for my system.
Here is the list of recipes required by Lazarus App:
libmd
libgssglue
zstd
krb5
keyutils
You can check each of them here: https://layers.openembedded.org/layerindex/branch/master/recipes/
One thing remains pain for me which is libQt5Pas. It is not a standard recipe as others and no ready bitbake file which yocto can build, generate and integrate it into the linux image automatically.
So I made one. I took the source code of libQt5Pas from .\lazarus\lcl\interfaces\qt5\cbindings and created libqt5pas.bb file as below:
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---## Build libQt5Pas# SUMMARY = "libQt5Pas for Lazarus"SECTION = "libs"LICENSE = "LGPLv3"LIC_FILES_CHKSUM = "file://COPYING.TXT;md5=5d5b6fbba1566704ccfaecd6eb49518f" DEPENDS = "qtbase qtx11extras" S = "${WORKDIR}" SRC_URI += "file://Qt5Pas.pro"SRC_URI += "file://*.txt"SRC_URI += "file://*.pas"SRC_URI += "file://src/*.h"SRC_URI += "file://src/*.cpp"SRC_URI += "file://src/*.c" inherit qmake5
And finally when I execute bitbake libqt5pas, I get:
--- Quote ---In file included from ../src/qsessionmanager_c.cpp:12:
../src/qsessionmanager_c.h:24:88: error: 'QSessionManager::RestartHint' has not been declared
24 | C_EXPORT void QSessionManager_setRestartHint(QSessionManagerH handle, QSessionManager::RestartHint AnonParam1);
| ^~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:41001: tmp/qsessionmanager_c.o] Error 1
make: *** Waiting for unfinished jobs....
../src/qguiapplication_c.cpp: In function 'bool QGuiApplication_isSessionRestored(QGuiApplicationH)':
../src/qguiapplication_c.cpp:211:45: error: 'class QGuiApplication' has no member named 'isSessionRestored'
211 | return (bool) ((QGuiApplication *)handle)->isSessionRestored();
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:41294: tmp/qguiapplication_c.o] Error 1
ERROR: oe_runmake failed
--- End quote ---
Any idea why it could be?
Thank you.
-------------------
More digging about Qt5 version available in the system.
I use Yocto Dunfell which has qtbase 5.14.2 recipe. Therefor whole embedded linux system has Qt5 v5.14.2.
As I understand the latest libQt5Pas codes for Qt5 v5.6 LTS. (released in 2016 and obsolete in 2019).
I believe that above compiler error is caused because of version incompatibilities between Qt v5.6 and v5.14.
Now I see two paths to go.
Do you think that I shall try to downgrade whole Qt5 version in my yocto linux from 5.14 to 5.6 or
I shall try to upgrade libQt5Pas code to support Qt5 v5.14?
Thank you.
zeljko:
maybe qtcore and qtx11extras isn't enough....try to add qtwidgets and/or qtgui
BasePointer:
--- Quote from: zeljko on January 14, 2022, 09:53:16 am ---maybe qtcore and qtx11extras isn't enough....try to add qtwidgets and/or qtgui
--- End quote ---
Thank you for the suggestion.
As I see qtbase adds all required except Qt5X11Extras that's why I added it.
here is the details
--- Code: Text [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---'qtbase': 'Qt5 Qt5Concurrent Qt5Core Qt5DBus Qt5Gui Qt5Network Qt5OpenGL Qt5OpenGLExtensions Qt5PrintSupport Qt5Sql Qt5Test Qt5Widgets Qt5Xml','qtsvg': 'Qt5Svg','qtdeclarative': 'Qt5Qml Qt5Quick Qt5QuickWidgets Qt5QuickTest','qtxmlpatterns': 'Qt5XmlPatterns','qtsystems': 'Qt5PublishSubscribe Qt5ServiceFramework Qt5SystemInfo','qtscript': 'Qt5Script Qt5ScriptTools','qttools': 'Qt5Designer Qt5Help Qt5LinguistTools Qt5UiPlugin Qt5UiTools','qtenginio': 'Qt5Enginio','qtsensors': 'Qt5Sensors','qtmultimedia': 'Qt5Multimedia Qt5MultimediaWidgets','qtwebchannel': 'Qt5WebChannel','qtwebsockets': 'Qt5WebSockets','qtserialport': 'Qt5SerialPort','qtx11extras': 'Qt5X11Extras','qtlocation': 'Qt5Location Qt5Positioning','qt3d': 'Qt53DCollision Qt53DCore Qt53DInput Qt53DLogic Qt53DQuick Qt53DQuickRender Qt53DRender'
BasePointer:
Hello,
I stuck at the same problem. I have decided to compile it manually first. But it ends up with the same error.
I have installed qt5sdk and followed instructions in README.TXT in cbindings.
1. qmake -query
--- Code: ---mf@linux:~/yocto-projects/qt5sdk/cbindings$ qmake -query
QT_SYSROOT:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux
QT_INSTALL_PREFIX:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr
QT_INSTALL_PREFIX/raw:/usr
QT_INSTALL_ARCHDATA:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib
QT_INSTALL_ARCHDATA/raw:/usr/lib
QT_INSTALL_DATA:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share
QT_INSTALL_DATA/raw:/usr/share
QT_INSTALL_DOCS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share/doc
QT_INSTALL_DOCS/raw:/usr/share/doc
QT_INSTALL_HEADERS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/include
QT_INSTALL_HEADERS/raw:/usr/include
QT_INSTALL_LIBS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib
QT_INSTALL_LIBS/raw:/usr/lib
QT_INSTALL_LIBEXECS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib/libexec
QT_INSTALL_LIBEXECS/raw:/usr/lib/libexec
QT_INSTALL_BINS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/bin
QT_INSTALL_BINS/raw:/usr/bin
QT_INSTALL_TESTS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share/tests
QT_INSTALL_TESTS/raw:/usr/share/tests
QT_INSTALL_PLUGINS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib/plugins
QT_INSTALL_PLUGINS/raw:/usr/lib/plugins
QT_INSTALL_IMPORTS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/imports
QT_INSTALL_IMPORTS/raw:/usr/imports
QT_INSTALL_QML:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib/qml
QT_INSTALL_QML/raw:/usr/lib/qml
QT_INSTALL_TRANSLATIONS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share/translations
QT_INSTALL_TRANSLATIONS/raw:/usr/share/translations
QT_INSTALL_CONFIGURATION:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/etc
QT_INSTALL_CONFIGURATION/raw:/etc
QT_INSTALL_EXAMPLES:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share/examples
QT_INSTALL_EXAMPLES/raw:/usr/share/examples
QT_INSTALL_DEMOS:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/share/examples
QT_INSTALL_DEMOS/raw:/usr/share/examples
QT_HOST_PREFIX:/home/mf/yocto-projects/qt5sdk/sysroots/x86_64-tdxsdk-linux
QT_HOST_DATA:/home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib
QT_HOST_BINS:/home/mf/yocto-projects/qt5sdk/sysroots/x86_64-tdxsdk-linux/usr/bin
QT_HOST_LIBS:/home/mf/yocto-projects/qt5sdk/sysroots/x86_64-tdxsdk-linux/usr/lib
QMAKE_SPEC:linux-oe-g++
QMAKE_XSPEC:linux-oe-g++
QMAKE_VERSION:3.1
QT_VERSION:5.14.2
--- End code ---
2. qmake
--- Code: ---mf@linux:~/yocto-projects/qt5sdk/cbindings$ qmake
Info: creating stash file /home/mf/yocto-projects/qt5sdk/cbindings/.qmake.stash
Project MESSAGE: Note: This binding version was generated for Qt 5.6.1. Current Qt is 5.14.2
Project MESSAGE: Qt documents binary compatibility in each Version Change Note: http://qt.nokia.com/developer/changes
Project MESSAGE: Adding x11extras for XOrg platform.
Project MESSAGE: Pascal Qt Interface for binding platform: BINUX
Project MESSAGE: Install location: /home/mf/yocto-projects/qt5sdk/sysroots/aarch64-tdx-linux/usr/lib
--- End code ---
3. make
--- Code: ---mf@linux:~/yocto-projects/qt5sdk/cbindings$ make
..
..
aarch64-tdx-linux-g++ -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=... -c -pipe -O2 -pipe -g -feliminate-unused-debug-types --sysroot=... -Wfatal-errors -O2 -w -D_REENTRANT -fPIC -DBINUX -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../sysroots/aarch64-tdx-linux/usr/include/QtPrintSupport -I../sysroots/aarch64-tdx-linux/usr/include/QtWidgets -I../sysroots/aarch64-tdx-linux/usr/include/QtX11Extras -I../sysroots/aarch64-tdx-linux/usr/include/QtGui -I../sysroots/aarch64-tdx-linux/usr/include/QtNetwork -I../sysroots/aarch64-tdx-linux/usr/include/QtCore -Itmp -I../sysroots/aarch64-tdx-linux/usr/lib/mkspecs/linux-oe-g++ -o tmp/qdrag_c.o src/qdrag_c.cpp
aarch64-tdx-linux-g++ -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=... -c -pipe -O2 -pipe -g -feliminate-unused-debug-types --sysroot=... -Wfatal-errors -O2 -w -D_REENTRANT -fPIC -DBINUX -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../sysroots/aarch64-tdx-linux/usr/include/QtPrintSupport -I../sysroots/aarch64-tdx-linux/usr/include/QtWidgets -I../sysroots/aarch64-tdx-linux/usr/include/QtX11Extras -I../sysroots/aarch64-tdx-linux/usr/include/QtGui -I../sysroots/aarch64-tdx-linux/usr/include/QtNetwork -I../sysroots/aarch64-tdx-linux/usr/include/QtCore -Itmp -I../sysroots/aarch64-tdx-linux/usr/lib/mkspecs/linux-oe-g++ -o tmp/qsessionmanager_c.o src/qsessionmanager_c.cpp
In file included from src/qsessionmanager_c.cpp:12:
src/qsessionmanager_c.h:24:88: error: ‘QSessionManager::RestartHint’ has not been declared
24 | C_EXPORT void QSessionManager_setRestartHint(QSessionManagerH handle, QSessionManager::RestartHint AnonParam1);
| ^~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:41301: tmp/qsessionmanager_c.o] Error 1
--- End code ---
zeljko:
But QSessionManager::RestartHint should be declared in namespace. I really don't know why it isn't.
Navigation
[0] Message Index
[#] Next page