Qt Tools for VS problem -- could not find a part of the path. Compiler issue I presume.
-
Hi, New to Qt, going through the Qt Academy tutorials, not getting very far because I'm having a LOT of issues just following the steps in the videos. I'm on "Getting Started with Qt Tools for Visual Studio". You simply install the Qt Tools extension in VS and create an empty Qt Quick app -- simple enough. Installed the tools, but when it comes to choosing a Qt version there are no MSVC folders in C:\Qt\6.6.1 for me to path to. Went to Manage Kits in Qt Creator to manually add the MSVC2019 compiler with path to cl.exe as I found the suggestion in another forum post.
Now there's an MSVC folder in C:\Qt\6.6.1 with a bin and qmake.exe inside as expected, great. Select that for my Qt Version path but it doesn't auto-populate the version name as it was supposed to. I entered the name manually, seems fine, select it as default, create new project -> Qt Quick app, give it a name, select "Create," opens the Wizard with the MSVC compiler selected for Debug and Release, select "Finish."
This is the problem. I get an error popup that says "Exception of type 'System.Exception' was thrown." The folder and project file are created anyway, but when I attempt to open the project, I get this:
I am truly so lost. I already did a clean reinstall today hoping it would help, no dice. My VS install is fine and functional. I can't find anything in the forum about this. Please help me understand what is going on here. Can post any requested info.
Bonus: If anyone can tell me why my Qt Creator didn't install correctly in the first place even when I followed the video steps I'd love to know, because it's been a neverending fount of consecutive configuration errors that seem atypical.
-
@_danae Looks like you've set the path to Qt to be
C:\Qt\6.6.1\msvc2019_64\bin\
when it should beC:\Qt\6.6.1\msvc2019_64\
(withoutbin
) so it looks for the mkspecs directory at the wrong level.In Visual Studio go to Extensions -> Qt VS Tools -> Qt Versions and add a Qt version there (if you don't have one already). The name is not important, it's just something for you to distinguish if you have multiple versions installed. Make sure the path points to the top of Qt version installation directory. It's the one that contains the bin, include, lib and other directories. Sounds like
C:\Qt\6.6.1\msvc2019_64\
in your case.Qt Creator is another IDE that you can use as an alternative to Visual Studio. They are separate programs, so changing settings in one has nothing to do with the other. You don't need both, just the one you like more.
-
@Chris-Kawa Thanks so much for responding. I didn't even think about looking elsewhere in the directory, I was just following the instructions in the Qt Academy tutorial and this is what it said!
I was trying everything I could to make things show up like they should. But I'll reach out to support about fixing the instruction, because I bet I'm not the only one who will come across this. The fix really was that simple and it solved my problem -- feels a little silly! Thanks again.
-
-
@_danae When adding Qt version in Qt Creator you point it to the qmake.exe file (which is in the bin directory) and it figures out the top directory from that. In VS extension you have to enter the top directory manually, so it's a bit different way to achieve the same in those IDEs and maybe that's where the error in the tutorial comes from.