Solved Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:"
-
@aha_1980,
Qt Versions are shown as follows:
HTH
Thanks -
You should also compare the Compilers tab and the Kits tab.
-
-
@SGaist ,
Here is the screen shot showing compilers
In that "Custom" is the one I created/added by entering the values for Compiler Path and Make Path
HTH
Thanks -
it doesn't work like this. MSVC compilers must be autodetected to be useable. Do you have the
vcvars*.bat
in the VS folder? -
@aha_1980 ,
Yes I do have them
How to use these batch files?
Please let me know
Thanks -
@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)
-
The reason why VS and kits is in non standard location is because it is used in that way for our other projects.
We have many projects on windows.
This is the first time I am trying Qt -
@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.
-
@mvelanka wow - good observation! glad you got it running. So please mark this topic as SOLVED now. Thanks!