Project ERROR: Cannot run compiler 'g++'. Output:
-
Hi, I've installed a Qt Creator 4.9.2 (Community) in Windows 10 via the open source link.
After installing it, I tried to create a project to try the tutorial in https://doc.qt.io/qtcreator/qt-creator-transitions-example.html. Here are the settings made:When I've installed Qt Creator for the first time several days ago, it worked without the following problems:
After several hours, these problems happened and I've no idea what went wrong. I've even tried reinstalling the Qt Creator and did a System Restore, but still encountered the same problem.
Any idea what's causing this?
-
Hi @joseph_ho, and welcome.
Did you install the MinGW compiler?
Please show the screenshots of your Qt Creator options:
- Tools > Options... > Kits > Kits
- Tools > Options... > Kits > Qt Versions
- Tools > Options... > Kits > Compilers
-
@joseph_ho said in Project ERROR: Cannot run compiler 'g++'. Output::
So far this problem happen only if I'm using the qmake build system. I didn't experience any problems if I'm using the Qbs build instead. Any ideas as to why?
Hmm... I can see that you have installed all your required tools. I'm not sure why you're having issues with the qmake build system.
Open a project and click on the "Project" button on the left navigation menu (it is between "Debug" and "Help"). Look at the Build Environment under Build Settings, and see if you notice anything there.
-
Hi @jksh, here is the screenshot of the Build Environment settings.
These are the values from the Path variable:
C:\Qt\Tools\mingw730_32\bin;
C:\Qt\5.12.4\mingw73_32\bin;
C:\Qt\Tools\mingw730_32\bin;
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0;
C:\Program Files\Git\cmd;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn;
C:\Program Files\PuTTY;
C:\Program Files\TortoiseGit\bin;
C:\WINDOWS\System32\OpenSSH;
C:\Python27;
C:\Program Files\TortoiseSVN\bin;
C:\Program Files (x86)\Java\jre1.8.0_191\bin\client;
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;
C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;
C:\Program Files\Intel\WiFi\bin;
C:\Program Files\Common Files\Intel\WirelessCommon;
C:\Program Files\nodejs;
C:\Program Files\Java\jre1.8.0_191\bin\server;
C:\Program Files\Java\jdk1.7.0_80\bin;
C:\Users\User\AppData\Roaming\npmThe odd thing was that when I've first installed and created the project, I could run it without any problems using qmake. A few hours later, this problem happened.
-
@joseph_ho said in Project ERROR: Cannot run compiler 'g++'. Output::
The odd thing was that when I've first installed and created the project, I could run it without any problems using qmake. A few hours later, this problem happened.
I can't see what's causing the problem, sorry.
- Does it also happen if you use the MinGW 64-bit kit?
- Does it also happen if you use a different Windows account to run Qt Creator?
-
@JKSH, apologies for the late reply.
In regard to your 2 suggestions:-
How do I run/test the MinGW 64-bit kit without running the Qt Creator?
-
I've downloaded & installed Qt Creator on another computer, and it worked without any problems there. This was done after the aforementioned problems started.
-
-
@joseph_ho said in Project ERROR: Cannot run compiler 'g++'. Output::
How do I run/test the MinGW 64-bit kit without running the Qt Creator?
In a terminal. Call
qmake.exe mingw32-make.exe
You can open a terminal using the shortcut created during Qt installation (doing so you make sure the environment is set up properly).
-
@joseph_ho You need to do these calls in your PROJECT directory...
-
@joseph_ho Yes, but please use full paths to qmake and make.
Also, you should use the command prompt from MinGW (you will find it in Windows start menu). You then will have ready made environment where you can call wmake/make without using full path. -
@joseph_ho said in Project ERROR: Cannot run compiler 'g++'. Output::
It is this, right?
Apparently not!
Why do you call make/qmake inside the MinGW installation directory?! We actually already clarified that.
You need to call it inside your project/build directory (from where you called qmake). -
cd YOUR_PROJECT_DIR PATH_TO_YOUR_QMAKE/qmake.exe PATH_TO_YOUR_MAKE/mingw32-make.exe
-
@joseph_ho You should use the command prompt from MinGW installation, then the environment will be setup and ready.