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
18 Posts 5 Posters 20.2k 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 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
                    • M Offline
                      M Offline
                      major_tom3
                      wrote last edited by
                      #17

                      I had this. I'd assumed 'g++' in the error message referred to some qmake target or something. No, it was much simpler. It's trying to invoke an executable called just that, whereas my compiler exe is called x86_64-linux-gnu-gcc-13. Creating a symlink solved the problem:
                      $ ln -s x86_64-linux-gnu-gcc-13 g++

                      SGaistS 1 Reply Last reply
                      0
                      • M major_tom3

                        I had this. I'd assumed 'g++' in the error message referred to some qmake target or something. No, it was much simpler. It's trying to invoke an executable called just that, whereas my compiler exe is called x86_64-linux-gnu-gcc-13. Creating a symlink solved the problem:
                        $ ln -s x86_64-linux-gnu-gcc-13 g++

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote last edited by
                        #18

                        @major_tom3 hi,

                        That's surprising that you have to create that symlink manually. Usually the package manager does that for you on installation.

                        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
                        0

                        • Login

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