Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
Qt 6.11 is out! See what's new in the release blog

Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 629 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rainight
    wrote on last edited by
    #1

    err info 1:

    
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:1551:1: error: invalid template-id
     1551 | Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:1551:53: error: ‘QRhiGraphicsPipeline::ColorMask’ has not been declared
     1551 | Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
          |                                                     ^~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:1551:1: error: ‘auto’ parameter not permitted in this context
     1551 | Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:1551:1: error: ‘constexpr void operator-(int)’ must have an argument of class or enumerated type
     1551 | Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:1551:53: error: ‘QRhiGraphicsPipeline::ColorMask’ has not been declared
     1551 | Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
    
    

    ed754add-ee28-47b4-ac0a-cf857344a80c-image.png

    err info 2

    In file included from /usr/include/EGL/eglplatform.h:128,
                     from /usr/include/EGL/egl.h:39,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtquick3d/src/xr/quick3dxr/openxr/qopenxrplatform_p.h:49,
                     from /mnt/sda1/qt-everywhere-src-6.11.1_build/qtbase/include/QtQuick3DXr/6.11.1/QtQuick3DXr/private/qopenxrplatform_p.h:1,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtquick3d/src/xr/quick3dxr/openxr/qopenxrgraphics_vulkan_p.h:22,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtquick3d/src/xr/quick3dxr/openxr/qopenxrgraphics_vulkan.cpp:6:
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:70:9: error: expected identifier before ‘int’
       70 |         Bool,
          |         ^~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:70:9: error: expected ‘}’ before ‘int’
    In file included from /mnt/sda1/qt-everywhere-src-6.11.1_build/qtbase/include/QtGui/6.11.1/QtGui/rhi/qshaderdescription.h:1,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshader.h:19,
                     from /mnt/sda1/qt-everywhere-src-6.11.1_build/qtbase/include/QtGui/6.11.1/QtGui/rhi/qshader.h:1,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qrhi.h:27,
                     from /mnt/sda1/qt-everywhere-src-6.11.1_build/qtbase/include/QtGui/6.11.1/QtGui/rhi/qrhi.h:1,
                     from /mnt/sda1/qt-everywhere-src-6.11.1/qtquick3d/src/xr/quick3dxr/openxr/qopenxrgraphics_vulkan.cpp:14:
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:42:23: note: to match this ‘{’
       42 |     enum VariableType {
          |                       ^
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:70:13: error: expected unqualified-id before ‘,’ token
       70 |         Bool,
          |             ^
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:188:9: error: ‘VariableType’ does not name a type
      188 |         VariableType type = Unknown;
          |         ^~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:200:9: error: ‘VariableType’ does not name a type
      200 |         VariableType type = Unknown;
          |         ^~~~~~~~~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:237:43: error: non-member function ‘QList<InOutVariable> inputVariables()’ cannot have cv-qualifier
      237 |     QList<InOutVariable> inputVariables() const;
          |                                           ^~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:238:44: error: non-member function ‘QList<InOutVariable> outputVariables()’ cannot have cv-qualifier
      238 |     QList<InOutVariable> outputVariables() const;
          |                                            ^~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:239:41: error: non-member function ‘QList<UniformBlock> uniformBlocks()’ cannot have cv-qualifier
      239 |     QList<UniformBlock> uniformBlocks() const;
          |                                         ^~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:240:51: error: non-member function ‘QList<PushConstantBlock> pushConstantBlocks()’ cannot have cv-qualifier
      240 |     QList<PushConstantBlock> pushConstantBlocks() const;
          |                                                   ^~~~~
    /mnt/sda1/qt-everywhere-src-6.11.1/qtbase/src/gui/rhi/qshaderdescription.h:241:41: error: non-member function ‘QList<StorageBlock> storageBlocks()’ cannot have cv-qualifier
      241 |     QList<StorageBlock> storageBlocks() const;
          |                                         ^~~~~
    

    247470c1-4e1c-449f-b0f7-f27c064b14f6-image.png

    env

    source

    https://download.qt.io/official_releases/qt/6.11/6.11.1/single/qt-everywhere-src-6.11.1.tar.xz

    lsb_release

    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 11 (bullseye)
    Release:        11
    Codename:       bullseye
    

    lscpu

    Architecture:                    aarch64
    CPU op-mode(s):                  32-bit, 64-bit
    Byte Order:                      Little Endian
    CPU(s):                          8
    On-line CPU(s) list:             0-7
    Thread(s) per core:              1
    Core(s) per socket:              2
    Socket(s):                       3
    Vendor ID:                       ARM
    Model:                           0
    Model name:                      Cortex-A55
    Stepping:                        r2p0
    CPU max MHz:                     2304.0000
    CPU min MHz:                     408.0000
    BogoMIPS:                        48.00
    L1d cache:                       256 KiB
    L1i cache:                       256 KiB
    L2 cache:                        1 MiB
    L3 cache:                        3 MiB
    Vulnerability Itlb multihit:     Not affected
    Vulnerability L1tf:              Not affected
    Vulnerability Mds:               Not affected
    Vulnerability Meltdown:          Not affected
    Vulnerability Mmio stale data:   Not affected
    Vulnerability Retbleed:          Not affected
    Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
    Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
    Vulnerability Spectre v2:        Vulnerable: Unprivileged eBPF enabled
    Vulnerability Srbds:             Not affected
    Vulnerability Tsx async abort:   Not affected
    Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
    

    uname -a

    Linux RK3588 5.10.160 #8 SMP Thu Nov 2 17:30:25 CST 2023 aarch64 GNU/Linux
    

    gcc -v

    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/local/gcc-10.5.0/libexec/gcc/aarch64-unknown-linux-gnu/10.5.0/lto-wrapper
    Target: aarch64-unknown-linux-gnu
    Configured with: ../configure --enable-languages=c,c++,d,fortran,objc,obj-c++ --enable-shared --enable-linker-build-id --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-gtk-cairo --with-arch-directory=aarch64 --enable-multiarch --enable-fix-cortex-a53-843419 --enable-checking=release --prefix=/usr/local/gcc-10.5.0
    Thread model: posix
    Supported LTO compression algorithms: zlib
    gcc version 10.5.0 (GCC)
    

    g++ -v

    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/usr/local/gcc-10.5.0/libexec/gcc/aarch64-unknown-linux-gnu/10.5.0/lto-wrapper
    Target: aarch64-unknown-linux-gnu
    Configured with: ../configure --enable-languages=c,c++,d,fortran,objc,obj-c++ --enable-shared --enable-linker-build-id --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-gtk-cairo --with-arch-directory=aarch64 --enable-multiarch --enable-fix-cortex-a53-843419 --enable-checking=release --prefix=/usr/local/gcc-10.5.0
    Thread model: posix
    Supported LTO compression algorithms: zlib
    gcc version 10.5.0 (GCC)
    

    configure

    ../qt-everywhere-src-6.11.1/configure -prefix /usr/local/Qt-6.11.1 -release -opensource -skip qtwebengine
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      @Rainight said in Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask):

      but how do i avoid it ?

      Don't include X11 headers in the first place or include them after Qt headers if you really need them.

      R Offline
      R Offline
      Rainight
      wrote on last edited by
      #6

      @Christian-Ehrlicher The qtquick module of Qt 6.11.1 source code includes these header files, and I definitely cannot make arbitrary changes to the official source code. In the end, I skipped the qtquickXXX modules, and the compilation worked normally.

      ../qt-everywhere-src-6.11.1/configure -prefix /usr/local/Qt-6.11.1 -release -opensource -skip qtwebengine -skip qtquick3d -skip qtquick3dphysics -skip qtquickeffectmaker -skip qtquicktimeline
      
      1 Reply Last reply
      0
      • V Offline
        V Offline
        Volker Hilsheimer
        wrote on last edited by
        #2

        QRhiGraphicsPipeline::ColorMask is declared as the flag-type based on QRhiGraphicsPipeline::ColorMaskComponent in line 1347.

        And the error with the Bool enum value in QShaderDescription makes me think that something is a bit more fundamentally off with your build environment. Can't say what though. Perhaps some system header pulls in a #define Bool int or something that throws everything off. Check the preprocessor output.

        R 1 Reply Last reply
        1
        • V Volker Hilsheimer

          QRhiGraphicsPipeline::ColorMask is declared as the flag-type based on QRhiGraphicsPipeline::ColorMaskComponent in line 1347.

          And the error with the Bool enum value in QShaderDescription makes me think that something is a bit more fundamentally off with your build environment. Can't say what though. Perhaps some system header pulls in a #define Bool int or something that throws everything off. Check the preprocessor output.

          R Offline
          R Offline
          Rainight
          wrote on last edited by
          #3

          @Volker-Hilsheimer Thank you for your reply. I replaced the compilation parameter -c in qopenxrgraphics_vulkan.cpp with -E, but I can't find the any suspicious place, Could you help me analyze it. here is the *.i file link: qopenxrgraphics_vulkan.cpp.i

          R 1 Reply Last reply
          0
          • R Rainight

            @Volker-Hilsheimer Thank you for your reply. I replaced the compilation parameter -c in qopenxrgraphics_vulkan.cpp with -E, but I can't find the any suspicious place, Could you help me analyze it. here is the *.i file link: qopenxrgraphics_vulkan.cpp.i

            R Offline
            R Offline
            Rainight
            wrote on last edited by
            #4

            I found the <X11/Xlib.h> has "#define Bool int"。but how do i avoid it ?
            1f0c4bfc-93ee-490b-8189-7a66456bf8eb-image.png
            2999154d-a9e5-4e13-8a97-edc065ac9582-image.png

            Christian EhrlicherC 1 Reply Last reply
            0
            • R Rainight

              I found the <X11/Xlib.h> has "#define Bool int"。but how do i avoid it ?
              1f0c4bfc-93ee-490b-8189-7a66456bf8eb-image.png
              2999154d-a9e5-4e13-8a97-edc065ac9582-image.png

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @Rainight said in Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask):

              but how do i avoid it ?

              Don't include X11 headers in the first place or include them after Qt headers if you really need them.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              R 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                @Rainight said in Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask):

                but how do i avoid it ?

                Don't include X11 headers in the first place or include them after Qt headers if you really need them.

                R Offline
                R Offline
                Rainight
                wrote on last edited by
                #6

                @Christian-Ehrlicher The qtquick module of Qt 6.11.1 source code includes these header files, and I definitely cannot make arbitrary changes to the official source code. In the end, I skipped the qtquickXXX modules, and the compilation worked normally.

                ../qt-everywhere-src-6.11.1/configure -prefix /usr/local/Qt-6.11.1 -release -opensource -skip qtwebengine -skip qtquick3d -skip qtquick3dphysics -skip qtquickeffectmaker -skip qtquicktimeline
                
                1 Reply Last reply
                0
                • R Rainight has marked this topic as solved on

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved