Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt Cmake configuration has no path to a C++ compiler set
Yesterday, while working with QtCreator I got the typical warning stating that some updates were available. As usual, I decided to apply these.
To my surprise, now I cant work with Qt. Each time I try to open a project, no matter what it is, I get an error stating that the cl compiler for CMake can't be found.
Curious, since my project uses no CMake at all. I have surfed the web looking for a solution and tried several of these, to no avail.
It looks like the kits I've installed have a misconfiguration problem. Checking the options and then the kits, this is what I see (for the 64-bit kit):
Until the update of Qt, everything worked like a charm. Of course, MSVS2015 is installed and works well when used as a standalone tool (not in tandem with Qt). It is only after the update that Qt complained.
Of course, I tried to uninstall and reinstall Qt, again to no avail.
The situation now is that I'm stuck and that I cannot keep working in my project, which is a rather.... annoying.... situation.
- Windows 10 2020 H2 up to date.
- Qt MSVC2015 5.9.2 for both 32/64 bits.
Thank you very much in advance.
Sorry, but in my previous post I didn't notice that the image was incorrectly cut.
Here's the correct one:
IIRC this happens if you start Qt Creator 4.15, but then later on move back to an older Qt Creator version.
You can try to mitigate this by clicking 'Change...' in the 'CMake COnfiguration' of your kit, and then 'Reset'.
I have never used QtCreator 4.15, since in my computer 4.14 is the version that got installed when the last update took place.
I have solved (miraculously) the problem. I uninstalled Qt, CMake & Visual Studio Community edition 2015. Then I reinstalled everything. It didn't work. That was yesterday, very late. This morning, after the laptop was shut down yesterday and switched on this morning the problem... simply vanished.
Now I'm ready to work, but this misconfiguration problem got me against the ropes and panting for more than 12 hours.
Thanks for your help.
I was too quick to say that the problem was solved.
It is true that now there are no complains about the Cmake configuration. The kits seem to be correctly configured.
I can edit my source code.
But I cannot compile it. As soon as I try to do it, I get the message "Failed to find Windows kit" (or something alike).
I'm reinstalling once again, changing from 5.9 to 5.15, the latest LTS, to see if this solves the problem.
Finally, it's working.
This is how I proceeded and these the results:
Uninstall the original Qt 5.9.2 package. Uninstall VS2015. Uninstall CMake. Clean the registry (using CCleaner) to remove any references to Qt, CMake or VS2015 in my system. Restart the system. Reinstall the same components (Qt 5.9.2, last version, in this case, of CMake, and VS2015). Result: the original problem remained (CMake misconfiguration in Qt).
Uninstall Qt 5.9.2. Clean the registry. Restart the system. Install the latest 5.9 version of Qt (can't recall the third level number, but as I say, it was the last one for 5.9). Result: the problem concerning the misconfiguration of Qt vanished. Apparently, all kits were properly configured. However, trying to compile a project produced the "Unable to find the Windows development kit" stated in my previous post.
Uninstall Qt 5.9.last_sub_sub_version. Clean the registry. Restart the system. Install the latest LTS available from Qt (15.5.2). Result: I can compile my projects without problems. The issue is solved.
I don't know what was going on, but I've been forced to jump from 5.9.2 to 5.15.2, quite a long distance between versions. Fortunately, it seems that my most complicated project using Qt compiles correctly.
Can someone explain this weird issue? To me, it sounds like a problem with the latest version of Qt Creator, since this tool was one of the components changed when the update was applied.
At any rate, I can keep working after two days of struggling with a misconfiguration problem with the tool.
All's well that ends well (Shakespeare) --- but sometimes it has a high cost (myself).
Sunita Marshal last edited by Sunita Marshal
Almost the same scenario here :(
I've had an unpleasant experience for QML projects on one of my machine when I upgraded Qt to v5.15.2 and Qt Creator to v4.14.4 as mentioned in the following post:
So on a 2nd machine where Qt v5.9.2 already installed with Qt Creator v4.4.1, I decided to play safe and installed Qt Creator v4.14.3 in parallet to my old v4.4.1. Unfortunately I'm unable to set any kit as shown in the pic below:
So no compile and build is possible with Qt Creator v4.14.3 for new projects :(
But strangely my old QML project made with Qt Creator v4.4.1 is being successfully built and run with v4.14.3.
Is there any workaround to configure Qt Creator v4.14.3 with Qt v5.9.2 for new projects ?
@Sunita-Marshal What exact problem do you have with the Kits in newer QtCreator? Position the cursor over the yellow/red icon next to the Kit name and check the popup message.
Sunita Marshal last edited by Sunita Marshal
@jsulm I don't know exactly what I did, but the yellow explanation icons next to the main kits Desktop Qt 5.9.2 MSVC2015 32bit & 64bit have been vanished. When there were explanation icons, I hovered the mouse over them and it showed exactly the same: https://forum.qt.io/topic/122616/qt-cmake-configuration-has-no-path-to-a-c-compiler-set/2
As I remember, I did the following and one of them did the trick:
(1) I built some simple QML project in old Qt Creator v4.4.1. Then I opened the same project in new v4.14.3, cleaned and rebuilt it.
(2) I ran new Qt Creator as Administrator and under Kits, there is Qt Versions tab. I clicked Link with Qt… button. The path was already filled with
It was the path to my old Qt Creator v4.4.1. I didn’t modify it and let it try.
I did some other things as well like system restart etc but not sure whether they helped or not.
So finally I’m able to build new projects of Qt 5.9.2 with newer Qt Creator v4.14.3.
Just a side note – as I have installed the only Qt v5.9.2, so I’ve to make sure to set the Minimal required Qt version to v5.9 or less. Otherwise no suitable kit is available message appears next to the available kits.
Dmitriano last edited by
I fixed this buy changing C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat with C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_arm64.bat, see https://developernote.com/2021/09/how-i-fixed-cmake-configuration-has-no-path-to-c-compiler-in-qt-creator/
Shaoning Di last edited by
@Dmitriano How can you get the vcvarsx86_arm64.bat file?And do you need to run this bat?
How can you get the vcvarsx86_arm64.bat file?
Please take a closer look at what @Dmitriano wrote: the path tells you how to get it (hint: it is part of Visual Studio)...
Shaoning Di last edited by
@jsulm Yeah, I had run that file, but it didn't work.
but it didn't work
What exactly did not work?