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. qmake unable to build qt6 project on centos8
Forum Updated to NodeBB v4.3 + New Features

qmake unable to build qt6 project on centos8

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.3k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    GregB
    wrote on last edited by
    #1

    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?

    kshegunovK 1 Reply Last reply
    0
    • G GregB

      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?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      Compiler version?

      $> g++ -v
      

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GregB
        wrote on last edited by
        #3
        $> 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) 
        
        kshegunovK 1 Reply Last reply
        0
        • G GregB
          $> 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) 
          
          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          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?

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GregB
            wrote on last edited by
            #5

            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
            
            1 Reply Last reply
            0
            • G Offline
              G Offline
              GregB
              wrote on last edited by
              #6

              And... that was the issue!

              Building the project on Rocky Linux 8.5 worked. There must be something slightly different in the build environment of CentOS Stream 8.

              1 Reply Last reply
              1
              • Chris BC Offline
                Chris BC Offline
                Chris B
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0

                • Login

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