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

ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.



  • Trying to compile qt 5.9 for my raspberry pi 3 compute module and I have been following mainly the online guide here (http://wiki.qt.io/Raspberry_Pi_Beginners_Guide). So, I have set the pi system roots to the mount point /mnt/pi-rootfs.
    Please note I m using Raspbian Stretch.

    The qtbase configuration was called with the following argument:
    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi

    This configures qt but no openGL and I have the message:
    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.

    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

    In addition, I also tried to add these 'QMAKE_INCDIR_OPENGL QMAKE_INCDIR_OPENGL QMAKE_INCDIR_OPENGL' to qmake.conf in linux-rasp-pi-g++ but still no sucess.

    Please advise how to fix these issues.


  • Qt Champions 2019

    @MAKK Add -v parameter to configure call and see what exactly is wrong with opengles2



  • @jsulm please find he below link containing logs.
    https://www.dropbox.com/s/6s2zsh2f24782eg/Rpilogs.txt?dl=0


  • Qt Champions 2019

    @MAKK You're missing the libs:

    > /home/minhaj/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lGLESv2
    > /home/minhaj/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lEGL
    


  • @jsulm how can I fix it and get these libs... please advise em newbie..


  • Qt Champions 2019

    @MAKK Well, you need these libs in your sysroot: /mnt/rasp-pi-rootfs. If your sysroot is a copy of the RaspPi root file system then install the libs there (apt-get on RaspPi).



  • @jsulm This means I have to put raspbian-stretch.img to SDCard & update it. After that convert it back to image & mount it... Then run again configure command...


  • Qt Champions 2019

    @MAKK Or just put the SDCard into your laptop/PC after updating :-)



  • I had this same error and in my particular case it was due to undefined references in GL libraries:

    Checking for OpenGL ES 2.0...
    Trying source 0 (type pkgConfig) of library opengl_es2 ...

    • PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/pkg-config --exists --silence-errors glesv2
    • PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/pkg-config --modversion glesv2

    2.0.0

    • PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/pkg-config --libs-only-L glesv2
    • PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/pkg-config --libs-only-l glesv2

    -lGLESv2

    • PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/pkg-config --cflags glesv2
    • cd /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/build/config.tests/opengl_es2 && PKG_CONFIG_SYSROOT_DIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot PKG_CONFIG_LIBDIR=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/pkgconfig /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/qmake -qtconf /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/build/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot" "QMAKE_LFLAGS += --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot" -early "CONFIG += cross_compile" 'LIBS += -lGLESv2' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/build/config.tests/opengl_es2
    • cd /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/build/config.tests/opengl_es2 && MAKEFLAGS= make

    aarch64-agl-linux-g++ -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -Wa,--noexecstack -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -Wa,--noexecstack -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot -c -pipe -O2 -fomit-frame-pointer -Wa,--noexecstack -fexpensive-optimizations -frename-registers -ftree-vectorize -finline-functions -finline-limit=64 -Wno-error=maybe-uninitialized -Wno-error=unused-result -fvisibility-inlines-hidden -DLINUX=1 -DWL_EGL_PLATFORM --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot -O2 -w -fPIC -I. -I/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/git/mkspecs/linux-oe-g++ -o main.o main.cpp
    aarch64-agl-linux-g++ -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -Wa,--noexecstack -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -Wa,--noexecstack -Wformat -Wformat-security -Werror=format-security --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now,-z,noexecstack -Wl,-z,relro,-z,now,-z,noexecstack --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot --sysroot=/home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot -Wl,-O1 -o opengl_es2 main.o -lGLESv2
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/aarch64-agl-linux/../../libexec/aarch64-agl-linux/gcc/aarch64-agl-linux/7.3.0/ld: warning: libglib-2.0.so.0, needed by /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so, not found (try using -rpath or -rpath-link)
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/aarch64-agl-linux/../../libexec/aarch64-agl-linux/gcc/aarch64-agl-linux/7.3.0/ld: warning: libcutils.so.0, needed by /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so, not found (try using -rpath or -rpath-link)
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/aarch64-agl-linux/../../libexec/aarch64-agl-linux/gcc/aarch64-agl-linux/7.3.0/ld: warning: libuhab.so, needed by /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so, not found (try using -rpath or -rpath-link)
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot-native/usr/bin/aarch64-agl-linux/../../libexec/aarch64-agl-linux/gcc/aarch64-agl-linux/7.3.0/ld: warning: libion.so.0, needed by /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so, not found (try using -rpath or -rpath-link)
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to habmm_socket_recv' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so: undefined reference tog_strlcpy'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to habmm_import' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so: undefined reference tog_strlcat'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so: undefined reference to property_get_bool' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference tohabmm_export'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to habmm_socket_open' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference tohabmm_socket_close'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to ion_alloc_fd' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libGLESv2.so: undefined reference tog_vsnprintf'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to habmm_socket_send' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference toion_open'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to habmm_unexport' /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference tohabmm_unimport'
    /home/ester/qt5.11/snapdragon-auto-gen3-hqx-spf-0-1_hlos_dev_lv/lvgvm/apps_proc/build/tmp-glibc/work/aarch64-agl-linux/qtbase/5.11.3+gitAUTOINC+08de243eaa-r0/recipe-sysroot/usr/lib64/libgsl.so: undefined reference to `ion_close'
    collect2: error: ld returned 1 exit status
    Makefile:66: recipe for target 'opengl_es2' failed
    make: *** [opengl_es2] Error 1
    => source failed verification.

    I was building with Yocto 2.6, so I simply had to add missing DEPENDS:

    DEPENDS += "libcutils libuhab libion"


Log in to reply