Qt 6.11.1 build Error: Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
-
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)
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; | ^~~~~
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: bullseyelscpu
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 asimddpuname -a
Linux RK3588 5.10.160 #8 SMP Thu Nov 2 17:30:25 CST 2023 aarch64 GNU/Linuxgcc -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 -
@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.
@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 -
QRhiGraphicsPipeline::ColorMaskis declared as the flag-type based onQRhiGraphicsPipeline::ColorMaskComponentin line 1347.And the error with the
Boolenum value inQShaderDescriptionmakes 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 intor something that throws everything off. Check the preprocessor output. -
QRhiGraphicsPipeline::ColorMaskis declared as the flag-type based onQRhiGraphicsPipeline::ColorMaskComponentin line 1347.And the error with the
Boolenum value inQShaderDescriptionmakes 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 intor something that throws everything off. Check the preprocessor output.@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
-
@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
-
@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.
-
@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.
@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 -
R Rainight has marked this topic as solved on

