Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:"
-
I am new to Qt and this is my first post.
I am using Qt 5.12 on two different computers ... both on MSVC (MSVisual Stuido 2017 ) identical version on both the machines but at different locations
computer 1. standard location c:\program files .... etc
Qt 5.12 is installed on e drive ..........that is a usb drivecomputer 2. it is D:\ ..... etc
Qt is also installed on D:\Qt directoryOn computer 1, I have absolutely no problem.
QtCreator started in next minute and I could compile and run textedit project in 10 minutes.On computer 2, I cannot use Qt creator at all
It did not set the kit itself like it did on computer 1
It told me to set up kits ......so I put the paths for cl.exe and cmake.exe (after reading on google and Qt forums)Still when I try to compile, it throws following error:
This is what I read from General Messages tab :
Running Windows Runtime device detection.
No winrtrunner.exe found.
Project ERROR: Cannot run compiler 'cl'. Output:===================
Maybe you forgot to setup the environment?
Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.
Project ERROR: Cannot run compiler 'cl'. Output:===================
Maybe you forgot to setup the environment?
Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.Please help or point me to where I can get proper direction.
Thanks -
Hi and welcome to devnet,
Did you install Visual Studio 2017 also on both machines ?
-
Running Windows Runtime device detection.
No winrtrunner.exe foundDo you want to create classic Windows programs or UWP apps? Looks like the Qt version here is for UWP, not sure that was your intention.
Regards
-
@mvelanka said in Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:":
No winrtrunner.exe found
seems like you did not install the
windows software development kit
? It's needed for the debugger.
AFAIC that one comes seperately from Visual Studio -
You should also compare the Compilers tab and the Kits tab.
-
@mvelanka QtCreator uns this batch file to setup the build environment. I'm not sure how it finds this file, but it seems your non-standard installation confuses it.
Any reason to not install MSVC on drive C? ( I guess Qt is fine on D, but for the compiler I'm unsure)
-
@mvelanka ,
Hopefully I have found the issue and the fix.Apparently, there is nothing wrong with Qt.
I looked in the source code for QtCreator on this page:
https://code.woboq.org/qt5/qt-creator/src/plugins/projectexplorer/msvctoolchain.cpp.html
(That may not be latest, however it gave me idea how QtCreator looks for the vcvars bat files.)
It looks in the registry.
For some strange reason, the path for VC was stored as
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
instead of
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
I do not know why!!So I manually fixed it in the registry to
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
and restarted QtCreator, went to kits.........it gave me all the possible combinations to choose VC compiler
I chose amd64_x86...........and everything is working okay
I have test built one example project (textedit) and it seems to be running well.I will still keep watch on both Qt and our other projects is this registry setup change creates any other issues.
Thanks for your support and clues.