qtbase compilation error with --device linux-rasp-pi3-g++ qeglfskmsgbmwindow.cpp



  • Hello. I'm new to compiling qt myself and I'm trying to compile qtbase for raspberry pi and I have compilation errors in file qeglfskmsgbmwindow.cpp. I think that maybe some eglfs source files changed with new raspbian stretch or something like that. Please point me in some direction how to fix it.
    I'm following tutorial from https://wiki.qt.io/RaspberryPi2EGLFS

    Technical information:
    device: Raspberry PI 3 B with Raspbian Stretch. apt uptade, apt upgrade and rpi-update done.
    QT: 5.11 from GIT
    configure command:

    ../qtbase/configure \
    -release -opengl es2 -v -opensource -confirm-license -make libs \
    -no-use-gold-linker \
    -device linux-rasp-pi3-g++ \
    -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \
    -sysroot ~/raspi/sysroot \
    -prefix /usr/local/qt5pi \
    -extprefix ~/raspi/qt5pi \
    -hostprefix ~/raspi/qt5
    

    Build options:

    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. yes
      Build parts ............................ libs
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... yes
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... yes
      udev ................................... yes
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ yes
      GLib ................................... yes
      iconv .................................. yes
      ICU .................................... no
      Tracing backend ........................ <none>
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... no
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      Linux AF_NETLINK ....................... yes
      OpenSSL ................................ yes
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ yes
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ yes
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. yes
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... yes
        PNG .................................. yes
          Using system libpng ................ yes
      EGL .................................... yes
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ yes
        OpenGL ES 3.0 ........................ yes
        OpenGL ES 3.1 ........................ yes
        OpenGL ES 3.2 ........................ yes
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... yes
      INTEGRITY HID .......................... no
      mtdev .................................. yes
      tslib .................................. yes
      xkbcommon-evdev ........................ yes
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. yes
      EGLFS details:
        EGLFS OpenWFD ........................ no
        EGLFS i.Mx6 .......................... no
        EGLFS i.Mx6 Wayland .................. no
        EGLFS RCAR ........................... no
        EGLFS EGLDevice ...................... no
        EGLFS GBM ............................ yes
        EGLFS VSP2 ........................... no
        EGLFS Mali ........................... no
        EGLFS Raspberry Pi ................... yes
        EGL on X11 ........................... no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
      X11:
        Using system-provided XCB libraries .. yes
        EGL on X11 ........................... no
        Xinput2 .............................. yes
        XCB XKB .............................. yes
        XLib ................................. yes
        XCB render ........................... yes
        XCB GLX .............................. yes
        XCB Xlib ............................. yes
        Using system-provided xkbcommon ...... no
        Native painting (experimental) ....... yes
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... yes
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. yes
      SQLite2 ................................ yes
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... yes
    

    The error

    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp: In member function ‘virtual void QEglFSKmsGbmWindow::resetSurface()’:
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:58:5: error: ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’ was not declared in this scope
         PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
         ^
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:58:46: error: expected ‘;’ before ‘createPlatformWindowSurface’
         PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
                                                  ^
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:9: error: ‘createPlatformWindowSurface’ was not declared in this scope
             createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
             ^
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected type-specifier before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
             createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
                                                            ^
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected ‘>’ before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:61:56: error: expected ‘(’ before ‘PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC’
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:62:68: error: expected ‘)’ before ‘;’ token
                 eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
                                                                        ^
    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp:65:9: error: ‘createPlatformWindowSurface’ was not declared in this scope
         if (createPlatformWindowSurface) {
             ^
    Makefile:2877: recipe for target '.obj/qeglfskmsgbmwindow.o' failed
    
    

  • Moderators

    @ronperek Are you trying this in a clean build directory? The issue may be a mix of the old EGL stuff and the freshly updated not being realized by the new build.



  • @ambershark Yes. I clean the build directory before each try.

    To my understanding, the problem I have is that the qt developers have another version of EGL library than I have on raspberry.

    I found missing declarations in sysroot/usr/include/EGL/eglext.h - version from 2016-08-09
    but qt uses sysroot/opt/vc/include/EGL/eglext.h - version from 2009-01-20

    I replaced EGL from opt/vc/include with EGL from usr/include but now I have different problem:

    /home/ron/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:74:5: error: ‘EGL_DISPMANX_WINDOW_T’ was not declared in this scope
    

    Of course missing declaration is present in 2009 version and removed in 2016 version.

    Am I the first one trying to compile QT 5.11 for Raspberry PI 3 with Raspbian Stretch?
    Do you have some tutorial to get full QT 5 working on PI?


  • Moderators

    @ronperek Yea it definitely sounds like an issue of mixing EGLs. From what I recall last time I built Qt is that you could specify whether to use Qt's version or your own for most components which I would assume (big assumption here) applies to EGL as well. It's possible you can just point it at the EGL to use so you can make sure your Pi and build machine have the same EGL.

    I don't have a tutorial on getting Qt5 running on a Pi. I've never actually done it. I have done a decent amount of cross compiling though so I've helped a lot of people get their builds running for Pi on these forums (which you can search). Some of them listed tutorials but I didn't pay enough attention to them to remember.

    As for being the first one to build, you may be. :) 5.11 is in beta so it's possible you are on bleeding edge that just hasn't been thoroughly vetted yet.

    Also this:

    I replaced EGL from opt/vc/include with EGL from usr/include but now I have different problem

    will never work. You definitely don't want to just replace includes like that.

    It sounds like you just need to force Qt (via configure) to use the version of EGL you want. However be warned you'll have to have that one compiled for your Pi in order to have Qt build with it.



  • I finally managed to get it compiled. I know it's not the pretty solution and that this may get back at me sometime, but for now it works.
    I run "make" with 2009 EGL version in place, then i replaced it with 2016 EGL version and run "make" again to compile file that failed. Finally I restored 2009 EGL.


  • Moderators

    @ronperek Yea that's most definitely going to bite you, lol. I wish I could have helped you solve your problem I just haven't done that compile so my advice was just some guesses.

    Hopefully it works out for you, but I wouldn't feel confident distributing it like that. If it's for in house developers/user or just yourself then that's ok but if that goes to customers you will have some issues to deal with.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.