Skip to main content
Associate III
August 12, 2024
Solved

libGLESv2.so.2 Error with Qt Application on STM32

  • August 12, 2024
  • 1 reply
  • 6796 views

Hi ST Community, @Erwan SZYMANSKI 

I’ve been working on integrating a Qt example from ~/Qt/Examples/Qt-6.7.2/quickcontrols/imagine into my custom Yocto layer for an STM32 board. I created a recipe for this and updated my local.conf accordingly. After building the image and flashing it to my board, I encountered the following error when running the application. I have added my .bb recipe file and local.conf file. (I have qt5 layer installed too)

 

nesnes@nesnes-ABRA-A5-V19-2:~/STM32MPU-Ecosystem-v5.1.0/Distribution-Package/build-openstlinuxweston-stm32mp15-disco$ bitbake automotive
NOTE: Started PRServer with DBfile: /home/nesnes/STM32MPU-Ecosystem-v5.1.0/Distribution-Package/build-openstlinuxweston-stm32mp15-disco/cache/prserv.sqlite3, Address: 127.0.0.1:33289, PID: 89725
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
Loaded 4703 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "2.4.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-ostl-linux-gnueabi"
MACHINE = "stm32mp15-disco"
DISTRO = "openstlinux-weston"
DISTRO_VERSION = "4.2.4-snapshot-20240812"
TUNE_FEATURES = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU = "hard"
DISTRO_CODENAME = "mickledore"
ACCEPT_EULA_stm32mp15-disco = "1"
GCCVERSION = "12.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-stm32mp"
meta-python 
meta-oe 
meta-gnome 
meta-multimedia 
meta-networking 
meta-webserver = "HEAD:aa5e8edabbc414d8ec1b2ad63c8743c7baf99626"
meta-st-stm32mp = "HEAD:1f152e07019dc06fd331b4926ec7e76ceae3d259"
meta-st-openstlinux = "HEAD:2636960b2bead3d1cb294e378e2b06ef8997189e"
meta = "HEAD:23b5141400b2c676c806df3308f023f7c04e34e0"
meta-my-layer = "<unknown>:<unknown>"
meta-st-x-linux-qt = "v1.0.0:1e51cb49240116fb512deccd8f6bad551918f866"
meta-qt5 = "scarthgap:eb828418264a49b8d00035cb3d7b12fcea3be801"

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 94 Local 94 Mirrors 0 Missed 0 Current 888 (100% match, 100% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2633 tasks of which 2633 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# automotive 
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# apt-get install libGLESv2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libGLESv2
root@stm32mp15-disco:~# automotive 
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# apt-get install libGLESv2.so.2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libGLESv2.so.2
E: Couldn't find any package by glob 'libGLESv2.so.2'
E: Couldn't find any package by regex 'libGLESv2.so.2'
root@stm32mp15-disco:~# sudo apt-get install -y libgles2-mesa-dev
-sh: sudo: command not found
root@stm32mp15-disco:~# apt-get install -y libgles2-mesa-dev
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa-dev
root@stm32mp15-disco:~# sudo apt-get install libegl1-mesa
-sh: sudo: command not found
root@stm32mp15-disco:~# apt-get install libgles2-mesa
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa
root@stm32mp15-disco:~# apt-get update
Reading package lists... Done
root@stm32mp15-disco:~# apt-cache search libgles2
libgles2-gcnano - Vivante libraries OpenGL ES, OpenVG and EGL (multi backend)
root@stm32mp15-disco:~# apt-get install libgles2-mesa-dev
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa-dev
root@stm32mp15-disco:~# apt-get install libgles2-gcnano
Reading package lists... Done
Building dependency tree... Done
libgles2-gcnano is already the newest version (6.4.15+20240206-r0.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

 

IMAGE_INSTALL += " gettemp"
IMAGE_INSTALL += " automotive"
DISTRO_FEATURES += " wayland"
IMAGE_INSTALL += " opkg grep" 
IMAGE_INSTALL += " libgles2"
IMAGE_INSTALL += " qtbase qtwayland qtquickcontrols2 qtdeclarative gcnano-userland-multi-binary-stm32mp "
CORE_IMAGE_EXTRA_INSTALL += " wayland weston" 
SUMMARY = "QT automotive recipe"
DESCRIPTION = "Recipe to build and install automotive application using Qt"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

# Source files location
SRC_URI = "file://src"

# Define dependencies
DEPENDS += "qtbase qtdeclarative qtquickcontrols2 wayland gcnano-userland-multi-binary-stm32mp"

# Source directory
S = "${WORKDIR}/src"

# Inherit necessary classes
inherit qmake5

# Build steps
do_configure() {
 # Change to the source directory where automotive.pro is located
 cd ${S}

 # Ensure that qmake is run on the correct .pro file
 ${OE_QMAKE_QMAKE} ${S}/automotive.pro
}

do_compile() {
 # Run the build command in the source directory
 cd ${S}
 ${MAKE}
}

# Install steps
do_install() {
 # Create installation directory
 install -d ${D}${bindir}
 
 # Install the compiled binary
 install -m 0755 ${S}/automotive ${D}${bindir}
}

# Specify installed files
FILES_${PN} += "${bindir}/automotive"

# Ensure the correct architecture for cross-compiling
TARGET_ARCH = "arm"

 

 

 

 

 

 

Best answer by Erwan SZYMANSKI

Hello @nesnes ,
Thanks to this test, my doubt seems to be confirmed. I made the test myself, can you please try to replace your configuration line by exactly :

 

IMAGE_INSTALL:append = " qtbase "

 

On my side, it seems to make the value of IMAGE_INSTALL clean back (see below)

 

IMAGE_INSTALL=" packagegroup-core-boot packagegroup-base-extended resize-helper packagegroup-framework-core-base packagegroup-framework-tools-base packagegroup-framework-core packagegroup-framework-tools packagegroup-framework-core-extra packagegroup-optee-core packagegroup-optee-test packagegroup-st-demo qtbase "

 

Kind regards,
Erwan

PS : I tested the same line with "+=" as you had, and can observe the same issue.

1 reply

Erwan SZYMANSKI
Technical Moderator
August 12, 2024

Hello @nesnes ,
Can you please share the content of your /vendor/lib folder on the board file system please ? If you see nothing, are you sure you well accepted the EULA for the GPU when you sourced your Distribution Package.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
nesnesAuthor
Associate III
August 14, 2024

@Erwan SZYMANSKI I encountered this problem when ı was trying to add an example qt application to the board. when ı build my distributions packet ı didn't have any problem, flashing the board works nicely but when I added the

 

IMAGE_INSTALL_append = " qtbase qtdeclarative qtwayland qtimageformats qtmultimedia"

 

 line to my local.conf and built st-image-weston again after flashing the board nothing works even the simple ls command. I couldn't understand the problem.Screenshot from 2024-08-13 17-39-35.png

 

Screenshot from 2024-08-13 17-39-40.png

 

Screenshot from 2024-08-13 17-39-46.png

 

Screenshot from 2024-08-13 17-40-03.png

 

Screenshot from 2024-08-14 09-21-41.png

 

Erwan SZYMANSKI
Technical Moderator
August 14, 2024

@nesnes ,
2 things to notice :

  • The "_append" command is not anymore a syntax supported by Yocto, instead you need to use ":append"
  • In your screenshot I do not see any error. If Yocto does nothing, this is because it detects it has nothing more to do and everything you ask to install is already on your image.

Kind regards,
Erwan. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.