qmake unable to build qt6 project on centos8
-
I'm trying to compile a project on CentOS 8, using the following command
~/Qt/6.2.3/gcc_64/bin/qmake -o ~/nidb/bin/smtp/Makefile -spec linux-g++ ~/nidb/src/smtp/SMTPEmail.pro
but I'm getting the following error
/home/greg/Qt/6.2.3/gcc_64/mkspecs/features/toolchain.prf:76: Variable QMAKE_CXX.COMPILER_MACROS is not defined. Project ERROR: failed to parse default search paths from compiler output
This worked fine for years with Qt 5.15.x on CentOS7 and CentOS8, but I can't seem to get it work on CentOS8 with Qt 6.2. But... it works on CentOS9 with Qt 6.2.
How can I fix this error?
-
I'm trying to compile a project on CentOS 8, using the following command
~/Qt/6.2.3/gcc_64/bin/qmake -o ~/nidb/bin/smtp/Makefile -spec linux-g++ ~/nidb/src/smtp/SMTPEmail.pro
but I'm getting the following error
/home/greg/Qt/6.2.3/gcc_64/mkspecs/features/toolchain.prf:76: Variable QMAKE_CXX.COMPILER_MACROS is not defined. Project ERROR: failed to parse default search paths from compiler output
This worked fine for years with Qt 5.15.x on CentOS7 and CentOS8, but I can't seem to get it work on CentOS8 with Qt 6.2. But... it works on CentOS9 with Qt 6.2.
How can I fix this error?
Compiler version?
$> g++ -v
-
$> g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 8.5.0 20210514 (Red Hat 8.5.0-7) (GCC)
-
$> g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 8.5.0 20210514 (Red Hat 8.5.0-7) (GCC)
Should be supported, I think. Please run
qmake
with verbose information (or more verbose being-d -d
), that should probably tell you where it trips, e.g.~/Qt/6.2.3/gcc_64/bin/qmake -d -o ~/nidb/bin/smtp/Makefile -spec linux-g++ ~/nidb/src/smtp/SMTPEmail.pro
Also what is the compiler on the latter version of the distro - the one that works correctly?
-
I thought that may be the issue, so I tried installing gcc-toolset-10. According to the Qt 6.2 supported configurations, it needs gcc 10 (toolset) on CentOS 8. On CentOS9, the gcc version is 11.2. But, even after installing gcc-toolset-10*, it still doesn't work.
Running qmake -d produced a lot of output, but the only error message is the same one as before
/home/greg/Qt/6.2.3/gcc_64/mkspecs/features/toolchain.prf:76: Variable QMAKE_CXX.COMPILER_MACROS is not defined. Project ERROR: failed to parse default search paths from compiler output
-
QT 6.2.4 and 6.3.0 both experience the issue on AlmaLinux 8 (latest). The problem, according to qmake -d is that the $$system() qmake macro does not return the output of the command. It does run it, if I redirect it to a file in toolchain.prf the file has the expected output.
I've tried it with a build using gcc-10,11 and also an install from the QT website. No joy on any of them. You said Rocky worked? Our organization is looking to move ahead to RHEL8 and with CentOS dead, this seemed like a valid option, but maybe we need to go with Rocky or Oracle Linux.