Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Missing GLESv2 library not found



  • Hi all, I am using a Ubuntu VM, running QTCreator 4.6.2 built on QT 5.10.1. I am doing a cross compile for an Emcraft STM32MP1 SOM and have loaded the tool chains etc.
    I create an empty Widget project for the STM but cannot link as it gets the errors below that says I am missing the GLESv2 library. (Possibly an issue with the toolchain) I get the same error regardless of if I run the make from QT Creator or the command line. Any help would be much appreciated.

    20:15:01: Running steps for project WidTest...
    20:15:01: Configuration unchanged, skipping qmake step.
    20:15:01: Starting: "/usr/bin/make"
    arm-openstlinux_weston-linux-gnueabi-g++ -march=armv7ve -marm -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/st/stm32mp1-som/2.4-snapshot/sysroots/cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/opt/st/stm32mp1-som/2.4-snapshot/sysroots/cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi -o WidTest main.o mainwindow.o moc_mainwindow.o -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lpthread
    /opt/st/stm32mp1-som/2.4-snapshot/sysroots/x86_64-openstlinux_weston_sdk-linux/usr/libexec/arm-openstlinux_weston-linux-gnueabi/gcc/arm-openstlinux_weston-linux-gnueabi/7.3.0/real-ld: cannot find -lGLESv2
    Makefile:239: recipe for target 'WidTest' failed
    collect2: error: ld returned 1 exit status
    make: *** [WidTest] Error 1
    20:15:01: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project WidTest (kit: stm32mp1Emcraft)
    When executing step "Make"
    20:15:01: Elapsed time: 00:00.


  • Qt Champions 2019

    @OscarCa So, did you install libgles2?



  • Good question and thank you for your reply. Yes I have and tried reinstalling etc. I am assuming that you mean install using:
    sudo apt-get install libgles2 ?


  • Qt Champions 2019

    @OscarCa Since you're cross compiling you need this lib in your sysroot, not host.



  • I am new to this! Any guidance on how install to the the sysroot would be awesome.


  • Qt Champions 2019

    @OscarCa How did you create the sysroot?
    Often you simply copy the content of your device filesystem to your host machine and use it as sysroot.
    In this case you need to install this lib (and dev part of it) on your device and then sync its filesystem to your sysroot.



  • I installed it using the Emcraft setup procedure at https://www.emcraft.com/products/1062#software which included the meta-toolchain-qt5-openstlinux-weston-stm32mp1-som-x86_64-toolchain-2.4-snapshot.sh



  • @jsulm @OscarCa Hello, I am having the same issue and am also fairly new to this so appreciate any help! I have been following this tutorial ( https://www.emsyslabs.com/how-to-compile-linux-using-yocto-for-stm32mp1/ ) for deployment on a STM32MP157a-DK2 board. To create the Toolchain I first executed the command:

    bitbake meta-toolchain-qt5
    

    Then I installed the SDK using:

    ./meta-toolchain-qt5-openstlinux-eglfs-stm32mp1-x86_64-toolchain-2.6-snapshot.sh
    

    And finally that generated the sysroot and an environment setup script:

    . /opt/st/stm32mp1/2.6-snapshot/environment-setup-cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi
    

    Now just to clarify, when you say "install this lib (and dev part of it) on your device and then sync its filesystem to your sysroot." you mean to ssh into the STM32MP1 device and install the library and sync the device filesystem to the sysroot on the host computer? I am a little confused as my sysroot has two sub folders: one "x86_64-openstlinux_eglfs_sdk-linux" where my qmake is located and another "cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi" that appears is the copy of my device file system.

    In addition, when I run apt-get install libgles2 on my target device I get the following message:

    eading package lists... Done
    Building dependency tree... Done
    Note, selecting 'gcnano-userland-multi-binary-stm32mp' instead of 'libgles2'
    gcnano-userland-multi-binary-stm32mp is already the newest version (6.2.4.p3-r0).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    

    I would appreciate any guidance.


  • Qt Champions 2019

    @braden_sun said in Missing GLESv2 library not found:

    one "x86_64-openstlinux_eglfs_sdk-linux" where my qmake is located and another "cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi" that appears is the copy of my device file system

    The first one is for the tools which you need to execute on your host (like qmake) those needs to be x86_64 as this is what your host is most probably. The other one contains the sysroot.
    Did you search in your sysroot for libgles* ?



  • Thanks for the reply. First of all here is the specific error message I get when trying to deploy to my target.

    06:07:02: Running steps for project stm32WidgetTest...
    06:07:02: Configuration unchanged, skipping qmake step.
    06:07:02: Starting: "/usr/bin/make" -j2
    arm-openstlinux_eglfs-linux-gnueabi-g++  -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/st/stm32mp1/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/opt/st/stm32mp1/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi -o stm32mp1Test main.o mainwindow.o moc_mainwindow.o   -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lpthread 
    /opt/st/stm32mp1/2.6-snapshot/sysroots/x86_64-openstlinux_eglfs_sdk-linux/usr/libexec/arm-openstlinux_eglfs-linux-gnueabi/gcc/arm-openstlinux_eglfs-linux-gnueabi/8.2.0/real-ld: cannot find -lGLESv2
    Makefile:240: recipe for target 'stm32mp1Test' failed
    collect2: error: ld returned 1 exit status
    make: *** [stm32mp1Test] Error 1
    06:07:02: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project stm32WidgetTest (kit: STM32MP1)
    When executing step "Make"
    06:07:02: Elapsed time: 00:00.
    

    Second, when I look in

    /opt/st/stm32mp1/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/usr/lib
    

    I can find the libgles libraries but they are highlighted red:

    Screen Shot 2020-05-08 at 9.36.54 AM.png

    Seems like they are in my sysroot but qt is looking for them in the x86 folder? I was cautious about creating a link from the cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/usr/lib directory to the x86 lib folder that the error points to since they are different architectures but I guess the error does point to an "arm" directory within x86.



  • @jsulm . Thanks for the help. I was able to copy them and others over and I can now successfully build. Again. thank you so much. :)
    Some of the other issues I had was that QTCreator needed to be launched from a terminal window as it didn't seem to pick up the the environment settings when you from run it from the Ubuntu desktop. But all sorted now.


  • Qt Champions 2019

    @OscarCa You can configure build and run environment in QtCreator.


Log in to reply