Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Project ERROR: Cannot run compiler 'g++'. Output
Forum Updated to NodeBB v4.3 + New Features

Project ERROR: Cannot run compiler 'g++'. Output

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
16 Posts 4 Posters 18.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.
  • Z Z3LD4

    I did yes. There's 2 images above that show MinGW selected. I still haven't managed to find a solution.

    aha_1980A Offline
    aha_1980A Offline
    aha_1980
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @z3ld4 I strongly suspect your PATH contains some incompatible entries - please show its contents.

    Also, I'd start with install only the 32bit Qt and MinGW version.

    Regards

    Qt has to stay free or it will die.

    1 Reply Last reply
    1
    • Z Offline
      Z Offline
      Z3LD4
      wrote on last edited by
      #5

      echo %PATH% yields:

      C:\Program Files\Microsoft HPC Pack 2012\Bin\;C:\Python37\Scripts\;C:\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Users\KraftWurk\drivers\chromedriver.exe;C:\Program Files\nodejs\;C:\tools\php73;C:\Qt\Qt5.12.4\Tools\mingw730_32\bin;C:\Qt\Qt5.12.4\Tools\mingw730_64\bin;C:\Users\KraftWurk\AppData\Roaming\Python\Python37\Scripts;C:\Users\KraftWurk\AppData\Local\Microsoft\WindowsApps;C:\Program Files\qemu;C:\Users\KraftWurk\AppData\Local\Programs\radare2;D:\win-bin\hugo;C:\Users\KraftWurk\AppData\Roaming\Composer\vendor\bin;C:\Program Files\7-Zip;C:\Program Files\ngrok;D:\masm32\bin;C:\php;C:\Users\KraftWurk\drivers\chromedriver.exe;C:\masm32\bin;C:\Users\KraftWurk\AppData\Roaming\npm;C:\Program Files (x86)\Dr. Memory\bin\;C:\Windows\System32;C:\tools\neovim\Neovim\bin;C:\lcc\bin;
      
      aha_1980A 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

        You have both the 32 and 64 bit folders of MinGW in your PATH. Remove them both. Qt Creator will do the adjustment needed when using the selected kit.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • Z Z3LD4

          echo %PATH% yields:

          C:\Program Files\Microsoft HPC Pack 2012\Bin\;C:\Python37\Scripts\;C:\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Users\KraftWurk\drivers\chromedriver.exe;C:\Program Files\nodejs\;C:\tools\php73;C:\Qt\Qt5.12.4\Tools\mingw730_32\bin;C:\Qt\Qt5.12.4\Tools\mingw730_64\bin;C:\Users\KraftWurk\AppData\Roaming\Python\Python37\Scripts;C:\Users\KraftWurk\AppData\Local\Microsoft\WindowsApps;C:\Program Files\qemu;C:\Users\KraftWurk\AppData\Local\Programs\radare2;D:\win-bin\hugo;C:\Users\KraftWurk\AppData\Roaming\Composer\vendor\bin;C:\Program Files\7-Zip;C:\Program Files\ngrok;D:\masm32\bin;C:\php;C:\Users\KraftWurk\drivers\chromedriver.exe;C:\masm32\bin;C:\Users\KraftWurk\AppData\Roaming\npm;C:\Program Files (x86)\Dr. Memory\bin\;C:\Windows\System32;C:\tools\neovim\Neovim\bin;C:\lcc\bin;
          
          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #7

          Hi @z3ld4,

          Please remove everything from your PATH except C:\Windows and C:\Windows\System32. It should be sufficent to do this in Qt Creators Build Environment for test purpose (in Projects mode, shortcut Ctrl+5).

          It is especially not needed to put the MinGW compilers in the PATH to use them from Creator. But your problem seems to be some other, incompatible shell (or make command), as

          'C:\Users\KraftWurk\shell.bat' is not recognized as an internal or external command,
          operable program or batch file.

          suggests.

          By the way, the red build path just means the directory does not exist yet, that's no problem.

          And everything else looks indeed correct.

          Crossing fingers for you :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          1
          • Z Offline
            Z Offline
            Z3LD4
            wrote on last edited by Z3LD4
            #8

            I've removed the entries from the path and still getting the same result.

            I'm not sure what is trying to call shell.bat. Is that a MinGW thing?

            aha_1980A 1 Reply Last reply
            1
            • Z Z3LD4

              I've removed the entries from the path and still getting the same result.

              I'm not sure what is trying to call shell.bat. Is that a MinGW thing?

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #9

              @z3ld4

              I'm not sure what is trying to call shell.bat. Is that a MinGW thing?

              That's what I'm trying to find out.

              1. Do you have such a file in C:\Users\KraftWurk?
              2. Can you show the generated Makefile(s)?

              Regards

              Qt has to stay free or it will die.

              Z 1 Reply Last reply
              0
              • aha_1980A aha_1980

                @z3ld4

                I'm not sure what is trying to call shell.bat. Is that a MinGW thing?

                That's what I'm trying to find out.

                1. Do you have such a file in C:\Users\KraftWurk?
                2. Can you show the generated Makefile(s)?

                Regards

                Z Offline
                Z Offline
                Z3LD4
                wrote on last edited by Z3LD4
                #10

                @aha_1980 No such file. Are there any tools that I can look to see what's making that call to the bat file? I got sysinternals tools installed.

                Sorry for the basic question, where can I find the generated make file?

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  Z3LD4
                  wrote on last edited by
                  #11

                  Is this error related? I've just spotted this one:

                  C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/toolchain.prf(76): Variable QMAKE_CXX.COMPILER_MACROS is not defined.
                  Project ERROR: failed to parse default search paths from compiler output
                  Error while parsing file C:\Qt\Qt5.12.4\Examples\Qt-5.12.4\gui\analogclock\analogclock.pro. Giving up.
                  
                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    Z3LD4
                    wrote on last edited by Z3LD4
                    #12

                    Still baffled by this. Tempted to do a fresh Windows install but it's going to take so much time. I also don't understand why also getting errors in editor.

                    0_1564267297055_e6daee30-bf1a-4678-85f6-002f187b8540-image.png

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      Z3LD4
                      wrote on last edited by Z3LD4
                      #13

                      Going to try install the previous version (5,12) and see if I get the same error.

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        Z3LD4
                        wrote on last edited by
                        #14

                        Same error. Full results:

                        Running Windows Runtime device detection.
                        No winrtrunner.exe found.
                        Running Windows Runtime device detection.
                        No winrtrunner.exe found.
                        Running Windows Runtime device detection.
                        No winrtrunner.exe found.
                        'C:\Users\KraftWurk\shell.bat' is not recognized as an internal or external command,
                        operable program or batch file.
                        Project ERROR: Cannot run compiler 'g++'. Output:
                        ===================
                        # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        # 1 "<built-in>"
                        # 1 "<command-line>"
                        # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        QT_COMPILER_STDCXX = 201402L
                        # 26 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        QMAKE_GCC_MAJOR_VERSION = 7
                        QMAKE_GCC_MINOR_VERSION = 3
                        QMAKE_GCC_PATCH_VERSION = 0
                        ===================
                        Maybe you forgot to setup the environment?
                        Error while parsing file C:\Qt\Qt5.12.4\Examples\Qt-5.12.4\gui\analogclock\analogclock.pro. Giving up.
                        'C:\Users\KraftWurk\shell.bat' is not recognized as an internal or external command,
                        operable program or batch file.
                        Project ERROR: Cannot run compiler 'g++'. Output:
                        ===================
                        # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        # 1 "<built-in>"
                        # 1 "<command-line>"
                        # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        QT_COMPILER_STDCXX = 201402L
                        # 26 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                        QMAKE_GCC_MAJOR_VERSION = 7
                        QMAKE_GCC_MINOR_VERSION = 3
                        QMAKE_GCC_PATCH_VERSION = 0
                        ===================
                        Maybe you forgot to setup the environment?
                        Error while parsing file C:\Qt\Qt5.12.4\Examples\Qt-5.12.4\gui\analogclock\analogclock.pro. Giving up.
                        
                        aha_1980A 1 Reply Last reply
                        0
                        • Z Z3LD4

                          Same error. Full results:

                          Running Windows Runtime device detection.
                          No winrtrunner.exe found.
                          Running Windows Runtime device detection.
                          No winrtrunner.exe found.
                          Running Windows Runtime device detection.
                          No winrtrunner.exe found.
                          'C:\Users\KraftWurk\shell.bat' is not recognized as an internal or external command,
                          operable program or batch file.
                          Project ERROR: Cannot run compiler 'g++'. Output:
                          ===================
                          # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          # 1 "<built-in>"
                          # 1 "<command-line>"
                          # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          QT_COMPILER_STDCXX = 201402L
                          # 26 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          QMAKE_GCC_MAJOR_VERSION = 7
                          QMAKE_GCC_MINOR_VERSION = 3
                          QMAKE_GCC_PATCH_VERSION = 0
                          ===================
                          Maybe you forgot to setup the environment?
                          Error while parsing file C:\Qt\Qt5.12.4\Examples\Qt-5.12.4\gui\analogclock\analogclock.pro. Giving up.
                          'C:\Users\KraftWurk\shell.bat' is not recognized as an internal or external command,
                          operable program or batch file.
                          Project ERROR: Cannot run compiler 'g++'. Output:
                          ===================
                          # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          # 1 "<built-in>"
                          # 1 "<command-line>"
                          # 1 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          QT_COMPILER_STDCXX = 201402L
                          # 26 "C:/Qt/Qt5.12.4/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
                          QMAKE_GCC_MAJOR_VERSION = 7
                          QMAKE_GCC_MINOR_VERSION = 3
                          QMAKE_GCC_PATCH_VERSION = 0
                          ===================
                          Maybe you forgot to setup the environment?
                          Error while parsing file C:\Qt\Qt5.12.4\Examples\Qt-5.12.4\gui\analogclock\analogclock.pro. Giving up.
                          
                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by
                          #15

                          @z3ld4 said in Project ERROR: Cannot run compiler 'g++'. Output:

                          Running Windows Runtime device detection.
                          No winrtrunner.exe found.

                          But that's something new. You now seem to somewhere have a WinRT alias UWP kit selected.

                          As I said before: I'd start with installing exactly ONE Qt MinGW version (I recommend 32 bit) and ONE MinGW compiler. Nothing else.

                          Then make sure you eleminate everything unneeded from the PATH variable before starting Creator.

                          Then create a new example (make sure nothing is left from previous attempts, especially no .pro.user and Makefiles).

                          Then qmake will generate Makefiles in the build folder, which in turn are used from make to generate your program. make will call the compilers to compile and the linker to finally link your program. If any of these calls pick the wrong program from the PATH, it will fail.

                          We already know that something at this point went wrong, so if it still goes wrong we need to analyze the Makefiles. But I think that really has to do with some other program in your PATH.

                          Regards

                          Qt has to stay free or it will die.

                          1 Reply Last reply
                          1
                          • P Offline
                            P Offline
                            Pacer
                            wrote on last edited by
                            #16

                            I had exactly the same problem with 5.13.1. Everything was set like on the screenshots above.
                            I also got the same errors when I tried 5.12.4.
                            After installing 5.13.1 again, nothing has changed. Still the same errors.

                            A few days later, I noticed that I haven´t updated Windows 10 (x64) to 1903. I was still on 1809.
                            After the Windows update, QT has worked properly! I did not changed anything in the QT settings or the PATH variables.
                            I don´t know, if the windows path variables have caused the problem as only windows specific paths have been added after the update, but it´s worth a try:

                            System Path variables before update:
                            C:\Program Files\CMake\bin
                            C:\Qt\Qt5.13.1\Tools\mingw730_32\bin

                            System Path variables after update:
                            C:\Program Files\CMake\bin
                            C:\Qt\Qt5.13.1\Tools\mingw730_32\bin
                            %SystemRoot%\system32
                            %SystemRoot%
                            %SystemRoot%\System32\Wbem
                            %SYSTEMROOT%\System32\WindowsPowerShell\v1.0
                            %SYSTEMROOT%\System32\OpenSSH\

                            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