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

ERROR: Feature 'opengles2' was enabled



  • Dears

     I‘m cross-compiling Qt5.9.6 on the debian10 .  And I've copied opengl es2 library to a file  from my renesas board like this:
    
    wadexu@wadexu:~/QT/sysroot$ tree
    .
    └── usr
        ├── include
        │   ├── EGL
        │   │   ├── eglext.h
        │   │   ├── eglext_REL.h
        │   │   ├── egl.h
        │   │   ├── eglplatform.h
        │   │   └── eglwaylandext.h
        │   ├── GL
        │   │   ├── glcorearb.h
        │   │   ├── glext.h
        │   │   ├── gl.h
        │   │   ├── gl_mangle.h
        │   │   ├── glxext.h
        │   │   ├── glx.h
        │   │   ├── glxint.h
        │   │   ├── glx_mangle.h
        │   │   ├── glxmd.h
        │   │   ├── glxproto.h
        │   │   ├── glxtokens.h
        │   │   └── internal
        │   │       ├── dri_interface.h
        │   │       └── glcore.h
        │   ├── GLES
        │   │   ├── egl.h
        │   │   ├── glext.h
        │   │   ├── gl.h
        │   │   └── glplatform.h
        │   ├── GLES2
        │   │   ├── gl2ext.h
        │   │   ├── gl2ext_REL.h
        │   │   ├── gl2.h
        │   │   └── gl2platform.h
        │   └── GLES3
        │       ├── gl2ext.h
        │       ├── gl2ext_REL.h
        │       ├── gl31.h
        │       ├── gl32.h
        │       ├── gl3.h
        │       └── gl3platform.h
        └── lib
            ├── libEGL.so
            ├── libEGL.so.1 -> libEGL.so
            ├── libglapi.so -> libglapi.so.0.0.0
            ├── libglapi.so.0 -> libglapi.so.0.0.0
            ├── libglapi.so.0.0.0
            ├── libGLESv2.so
            ├── libGLESv2.so.2 -> libGLESv2.so
            ├── libglslcompiler.so
            ├── libGL.so.1 -> libGL.so.1.2.0
            ├── libGL.so.1.2.0
            ├── libIMGegl.so
            ├── libpvrDRM_WSEGL.so
            ├── libpvrWAYLAND_WSEGL.so
            ├── libQt5OpenGL.so.5 -> libQt5OpenGL.so.5.6.3
            ├── libQt5OpenGL.so.5.6 -> libQt5OpenGL.so.5.6.3
            ├── libQt5OpenGL.so.5.6.3
            ├── libwayland-egl.so -> libwayland-egl.so.1.0.0
            ├── libwayland-egl.so.1 -> libwayland-egl.so.1.0.0
            ├── libwayland-egl.so.1.0.0
            ├── libxcb-glx.a
            ├── libxcb-glx.la
            ├── libxcb-glx.so -> libxcb-glx.so.0.0.0
            ├── libxcb-glx.so.0 -> libxcb-glx.so.0.0.0
            └── libxcb-glx.so.0.0.0
    
    9 directories, 56 files
    

    but when I run ./configure ......, there are an error occured :

    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.
    

    And there is my qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf sets :

    #
    # qmake configuration for building with aarch64-linux-gnu-g++
    #
    
    MAKEFILE_GENERATOR      = UNIX
    CONFIG                 += incremental
    QMAKE_INCREMENTAL_STYLE = sublib
    
    QT_QPA_DEFAULT_PLATFORM = linuxfb                 #指定Qt显示驱动方式
    QMAKE_CFLAGS_RELEASE   += -O2 -march=armv8-a -mtune=cortex-a53      #指定处理器架构
    QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv8-a -mtune=cortex-a53
     
    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)
    
    
    QMAKE_INCDIR += /opt/tslib/include /opt/sqlite3/include   #指定头文件,需预编译
    QMAKE_LIBDIR += /opt/tslib/lib /opt/sqlite3/lib           #指定库文件,需预编译
    
    
    QMAKE_INCDIR_OPENGL[_ES2] += \
         /home/wadexu/QT/sysroot/usr/include \
         /home/wadexu/QT/sysroot/usr/include/EGL \
         /home/wadexu/QT/sysroot/usr/include/GLES2 \
         /home/wadexu/QT/sysroot/usr/include/GLES3 \
         /home/wadexu/QT/sysroot/usr/include/KHR
    QMAKE_LIBDIR_OPENGL[_ES2] += \
         /home/wadexu/QT/sysroot/usr/lib
    
    # QMAKE_LIBS_OPENGL[_ES2] += -lEGL -lGLESv2
    #QMAKE_LIBS_OPENGL_ES2 = -lglapi -lGLESv2 -lEGL
    QMAKE_LIBS_OPENGL[_ES2] += -lbrcmEGL -lbrcmGLESv2
    
    # modifications to g++.conf
    QMAKE_CC                = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
    QMAKE_CXX               = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
    QMAKE_LINK              = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
    QMAKE_LINK_SHLIB        = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
    
    # modifications to linux.conf
    QMAKE_AR                = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ar cqs
    QMAKE_OBJCOPY           = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-objcopy
    QMAKE_NM                = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-nm -P
    QMAKE_STRIP             = /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-strip
    load(qt_config)
    

    Is there something still needed? I can't find where is wrong.

    Thanks
    Wade


  • Lifetime Qt Champion

    @Wade Please check the config.log file to see why exactly the test for opengles2 failed, or post its content here.



  • @jsulm Hi, jsulm

    I redirected my sysroot to my board's sysroot, now the ./configure can find the OpenGL ES2. But when I run ''make -j8'', there is an error occured:

    /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++ -c -include .pch/Qt5Core -pipe -I/home/wadexu/debian_buster_renesas_OpenGL_for_QT_15.1/usr/include --sysroot=/home/wadexu/debian_buster_renesas_OpenGL_for_QT_15.1 -march=armv8-a -mtune=cortex-a53 -march=armv8-a -mtune=cortex-a53 -O3 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../../include -I../../include/QtCore -I../../include/QtCore/5.9.6 -I../../include/QtCore/5.9.6/QtCore -I.moc -I../3rdparty/pcre2/src -I/opt/tslib/include -I/opt/sqlite3/include -I../../mkspecs/linux-aarch64-gnu-g++ -o .obj/qresultstore.o thread/qresultstore.cpp
    
    In file included from /home/wadexu/debian_buster_renesas_OpenGL_for_QT_15.1/usr/include/sys/stat.h:446,
                     from ../../mkspecs/linux-aarch64-gnu-g++/../linux-g++/qplatformdefs.h:75,
                     from ../../mkspecs/linux-aarch64-gnu-g++/qplatformdefs.h:40,
                     from global/qmalloc.cpp:40:
    /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/lib/gcc/aarch64-none-linux-gnu/10.2.1/include-fixed/bits/statx.h:48:10: fatal error: bits/statx-generic.h: 没有那个文件或目录
       48 | #include <bits/statx-generic.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    

    This is so wired. The message is telling me that I need bits/statx-generic.h, the $$[QT_SYSROOT]//usr/include/sys/stat.h has the following sentence:

    #ifdefine __USE_GNU
    # include <bits/statx.h>
    #endif
    

    But in the file $$[QT_SYSROOT]//usr/include/bits/statx.h, there is no sentence called the bits/statx-generic.h

    /* statx-related definitions and declarations.
       Copyright (C) 2018 Free Software Foundation, Inc.
       This file is part of the GNU C Library.
    
       The GNU C Library is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public
       License as published by the Free Software Foundation; either
       version 2.1 of the License, or (at your option) any later version.
    
       The GNU C Library is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Lesser General Public License for more details.
    
       You should have received a copy of the GNU Lesser General Public
       License along with the GNU C Library; if not, see
       <http://www.gnu.org/licenses/>.  */
    
    /* This interface is based on <linux/stat.h> in Linux.  */
    
    #ifndef _SYS_STAT_H
    # error Never include <bits/stat.x.h> directly, include <sys/stat.h> instead.
    #endif
    
    struct statx_timestamp
    {
      __int64_t tv_sec;
      __uint32_t tv_nsec;
      __int32_t __statx_timestamp_pad1[1];
    };
    
    /* Warning: The kernel may add additional fields to this struct in the
       future.  Only use this struct for calling the statx function, not
       for storing data.  (Expansion will be controlled by the mask
       argument of the statx function.)  */
    struct statx
    {
      __uint32_t stx_mask;
      __uint32_t stx_blksize;
      __uint64_t stx_attributes;
      __uint32_t stx_nlink;
      __uint32_t stx_uid;
      __uint32_t stx_gid;
      __uint16_t stx_mode;
      __uint16_t __statx_pad1[1];
      __uint64_t stx_ino;
      __uint64_t stx_size;
      __uint64_t stx_blocks;
      __uint64_t stx_attributes_mask;
      struct statx_timestamp stx_atime;
      struct statx_timestamp stx_btime;
      struct statx_timestamp stx_ctime;
      struct statx_timestamp stx_mtime;
      __uint32_t stx_rdev_major;
      __uint32_t stx_rdev_minor;
      __uint32_t stx_dev_major;
      __uint32_t stx_dev_minor;
      __uint64_t __statx_pad2[14];
    };
    
    #define STATX_TYPE 0x0001U
    #define STATX_MODE 0x0002U
    #define STATX_NLINK 0x0004U
    #define STATX_UID 0x0008U
    #define STATX_GID 0x0010U
    #define STATX_ATIME 0x0020U
    #define STATX_MTIME 0x0040U
    #define STATX_CTIME 0x0080U
    #define STATX_INO 0x0100U
    #define STATX_SIZE 0x0200U
    #define STATX_BLOCKS 0x0400U
    #define STATX_BASIC_STATS 0x07ffU
    #define STATX_ALL 0x0fffU
    #define STATX_BTIME 0x0800U
    #define STATX__RESERVED 0x80000000U
    
    #define STATX_ATTR_COMPRESSED 0x0004
    #define STATX_ATTR_IMMUTABLE 0x0010
    #define STATX_ATTR_APPEND 0x0020
    #define STATX_ATTR_NODUMP 0x0040
    #define STATX_ATTR_ENCRYPTED 0x0800
    #define STATX_ATTR_AUTOMOUNT 0x1000
    
    __BEGIN_DECLS
    
    /* Fill *BUF with information about PATH in DIRFD.  */
    int statx (int __dirfd, const char *__restrict __path, int __flags,
               unsigned int __mask, struct statx *__restrict __buf)
      __THROW __nonnull ((2, 5));
    
    __END_DECLS
    
    

    I guess there is a possible that the cross-compiler might to use the opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/./lib/gcc/aarch64-none-linux-gnu/10.2.1/include-fixed/bits/statx.h, that's why it needs the bits/statx-generic.h.

    # include <bits/statx-generic.h>
    

    I don't know why it does like that.

    Thanks
    Wade


Log in to reply