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:
#
# 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:
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
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.