Project ERROR: Cannot run compiler 'g++'. (Windows, Qt 5.15.2, MinGW 8.1.0 64bit, Qt Creator 6.0.1)
-
I installed the following (from Qt Online Installer):
-
I don't want to have to recompile Additional Libraries

-
I choose
Qt 5.15.2andQt Creator

-
In
Qt 5.15.2, I chooseMinGW 64bit(specifically version8.1.0) because I want to build64bitapplication

-
In Tools, I made sure I ticked the
MinGW 64bit toolchain(specifically version8.1.0)

After the installation was complete, I opened Qt Creator and noticed that the Kits had automatically set up the correct path. . But when I created a New Project and Build it, this error appeared (I also tried adding in the
PATHenvironment variable and Build the project but still got the error):Project ERROR: Cannot run compiler 'g++'. Output: =================== # 1 "C:/Qt/5.15.2/mingw81_64/mkspecs/features/data/macros.cpp" # 1 "<built-in>" # 1 "<command-line>" # 1 "C:/Qt/5.15.2/mingw81_64/mkspecs/features/data/macros.cpp" QT_COMPILER_STDCXX = 201402L # 26 "C:/Qt/5.15.2/mingw81_64/mkspecs/features/data/macros.cpp" QMAKE_GCC_MAJOR_VERSION = 8 QMAKE_GCC_MINOR_VERSION = 1 QMAKE_GCC_PATCH_VERSION = 0 =================== Maybe you forgot to setup the environment? 01:04:04: The process "C:\Qt\5.15.2\mingw81_64\bin\qmake.exe" exited with code 3. Error while building/deploying project untitled (kit: Desktop Qt 5.15.2 MinGW 64-bit) When executing step "qmake"I have been agonizing for days about this error. Before that I tried to install
MinGW32with Maintain Qt, I Build the same new project without the above error.I also tried replacing
5.15.2withQt 6.2.2withMinGW 64bit(inside the install) but that didn't work, tried theqt-opensource-windows-x86-5.12.12offline install withMinGW 64bit(inside the install). in the installation) and it doesn't work either)I wonder if Qt only supports building
32bitapps withMinGW32? Please don't laugh at this question of mine, I'm just a newbie and want to learn Qt. -
-
Make sure you are using the right mkspec with QMake. On Windows with MinGW 8.1.0 that's
win32-g++.Have you thought of using
CMakeinstead? -
CMakeworks right, I want to useqmakeand want to know exactly this issue.I am sure I use right
mkspec -
Hi, perhaps your PATH is a bit poisonous (for example you could have another g++ on your PC), you could try running Qt Creator with an empty path:
Open a CMD window, then typeset path= C:\Qt\Tools\QtCreator\bin\qtcreatorthen try to build a simple test program with your 5.15.2 MinGW 64-bit..
-
Hi, perhaps your PATH is a bit poisonous (for example you could have another g++ on your PC), you could try running Qt Creator with an empty path:
Open a CMD window, then typeset path= C:\Qt\Tools\QtCreator\bin\qtcreatorthen try to build a simple test program with your 5.15.2 MinGW 64-bit..
@hskoglund I will try all the suggestions from everyone, and your suggestion still doesn't work

You see, it doesn't seem to work even though I doset path= -
LoL, I already solved it.
And this is how I solved the issue. My
PATHis clean and nice, however, mycmd'sAutoRunis a mess. I tried deleting everything inAutoRun(HKCU\SOFTWARE\Microsoft\Command Processor\AutoRunorHKLM\SOFTWARE\Microsoft\Command Processor\AutoRun) for testing andQtwas able to build fine.My
AutoRunis messy because I integratedcmderintocmdbut didn't follow the author's guide. I stuffed a long script intoAutoRun(without creating a separate 'cmder_shell.bat' file) and it was working fine before I started usingQt. And now I see the above issue I mentioned.Hope my stupid experience helps those who face similar issue to have more solutions. For those who use
cmderintegrated intocmdplease follow the author's guide, don't be like me.