Qt doesn't find MSVC2017 compiler - installed from VS Build Tools 2019
-
wrote on 12 May 2019, 16:26 last edited by
Hi,
I did a new install after some time doing nothing with Qt/C++.
Win10 Pro x64, Qt via online installer, v5.12.3 with precompiled binaries for MSVC2015 and 2017.
I used Visual Studio Build Tools 2019 to get the compilers, VSBT2017 seems not available anymore.
In there I selected- MSVC v140 (VS2015, 14.00)-Buildtools
- MSVC v141 (VS2017, 14.16)
- MSVC v142 (VS2019, 14.20) - apparently needed for CMake-tools, which I need as well (?)
When starting QTCreator the only compilers that are available for selection are 'MS Visual C++ Compiler 14.0' (so MSVC2015) and '16.0' (which seems to be MSVC2019). So the one I'd actually want, MSVC2017 is missing. I accumulated that much info as that this might be due to new folder structures of Visual Studio related stuff, but no solution was presented, also this was from last year, when Build Tools 2019 weren't available yet.
What I also read was that Qt uses this file:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
to get the location of the compilers. In Build Tools 2019 this is the same file for v14.16 and v14.20, which are located in subfolders in
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.xx"
and I guess this is where everything gets messed up?This is as far as I got. I tried reinstalling Build Tools with only MSVC2017 selected, but that only left me with no compiler at all available in Qt. Maybe I could make a custom entry for the compiler in Qt, but I wouldn't know how to set that up. I'm able to program the things I want but anything beyond that isn't really in my skillset.
I didn't find anything recent about that, which confuses me a bit, as I can't be the only one with that problem. So I was hoping anyone here stumbled over that as well and found a solution.
Thanks for any help!
-
Hi,
I did a new install after some time doing nothing with Qt/C++.
Win10 Pro x64, Qt via online installer, v5.12.3 with precompiled binaries for MSVC2015 and 2017.
I used Visual Studio Build Tools 2019 to get the compilers, VSBT2017 seems not available anymore.
In there I selected- MSVC v140 (VS2015, 14.00)-Buildtools
- MSVC v141 (VS2017, 14.16)
- MSVC v142 (VS2019, 14.20) - apparently needed for CMake-tools, which I need as well (?)
When starting QTCreator the only compilers that are available for selection are 'MS Visual C++ Compiler 14.0' (so MSVC2015) and '16.0' (which seems to be MSVC2019). So the one I'd actually want, MSVC2017 is missing. I accumulated that much info as that this might be due to new folder structures of Visual Studio related stuff, but no solution was presented, also this was from last year, when Build Tools 2019 weren't available yet.
What I also read was that Qt uses this file:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
to get the location of the compilers. In Build Tools 2019 this is the same file for v14.16 and v14.20, which are located in subfolders in
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.xx"
and I guess this is where everything gets messed up?This is as far as I got. I tried reinstalling Build Tools with only MSVC2017 selected, but that only left me with no compiler at all available in Qt. Maybe I could make a custom entry for the compiler in Qt, but I wouldn't know how to set that up. I'm able to program the things I want but anything beyond that isn't really in my skillset.
I didn't find anything recent about that, which confuses me a bit, as I can't be the only one with that problem. So I was hoping anyone here stumbled over that as well and found a solution.
Thanks for any help!
@Photatum said in Qt doesn't find MSVC2017 compiler - installed from VS Build Tools 2019:
VSBT2017 seems not available anymore
https://visualstudio.microsoft.com/vs/older-downloads/
I'm not sure whether Qt already supports VS2019.
-
wrote on 13 May 2019, 16:14 last edited by
Ah, I missed that, thanks. It only said Visual Studio 2017, but the Build Tools are available on the following sub-page.
As far as precompiled versions go VS2019 isn't available, but as I said (maybe a bit convoluted), I tried to install the MSVC2017 compiler which is available in the 2019 Build Tools installer.
The folder structure is different. When installing MSVC2015 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio 14.0..." and Qt finds it without problems.When installing MSVC2017 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023"
(under "\2019\BuildTools"!)while MSVC2017 via 2017 Build Tools results in
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023"The first one isn't recognised, the latter is. So either the 2019 Build Tools mess up the correct path or Qt doesn't find the compiler in the new path.
This may be worth checking for future releases, I think?
Anyway, thanks again, MSVC2017 works now.
-
Ah, I missed that, thanks. It only said Visual Studio 2017, but the Build Tools are available on the following sub-page.
As far as precompiled versions go VS2019 isn't available, but as I said (maybe a bit convoluted), I tried to install the MSVC2017 compiler which is available in the 2019 Build Tools installer.
The folder structure is different. When installing MSVC2015 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio 14.0..." and Qt finds it without problems.When installing MSVC2017 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023"
(under "\2019\BuildTools"!)while MSVC2017 via 2017 Build Tools results in
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023"The first one isn't recognised, the latter is. So either the 2019 Build Tools mess up the correct path or Qt doesn't find the compiler in the new path.
This may be worth checking for future releases, I think?
Anyway, thanks again, MSVC2017 works now.
@Photatum I guess QtCreator needs to be adapted to different folder structure in order to recognise the compiler installed this way. I'm sure QtCreator developers are working on this :-) If not it is possible to file a change request.
-
Ah, I missed that, thanks. It only said Visual Studio 2017, but the Build Tools are available on the following sub-page.
As far as precompiled versions go VS2019 isn't available, but as I said (maybe a bit convoluted), I tried to install the MSVC2017 compiler which is available in the 2019 Build Tools installer.
The folder structure is different. When installing MSVC2015 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio 14.0..." and Qt finds it without problems.When installing MSVC2017 via 2019, it creates
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023"
(under "\2019\BuildTools"!)while MSVC2017 via 2017 Build Tools results in
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023"The first one isn't recognised, the latter is. So either the 2019 Build Tools mess up the correct path or Qt doesn't find the compiler in the new path.
This may be worth checking for future releases, I think?
Anyway, thanks again, MSVC2017 works now.
wrote on 21 Feb 2020, 16:41 last edited by jaray200How did you get the 2017 build tools? I am running into this exact same issue.
Looking at https://visualstudio.microsoft.com/vs/older-downloads/ I see the build tools for 2015, but the 2017 ones are no where to be found.
EDIT:
For other people who come across this, I was finally able to find a download. https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes This is the only place I could find a copy of the 2017 Community Edition. I have not been able to find a copy of just the build tools though. -
How did you get the 2017 build tools? I am running into this exact same issue.
Looking at https://visualstudio.microsoft.com/vs/older-downloads/ I see the build tools for 2015, but the 2017 ones are no where to be found.
EDIT:
For other people who come across this, I was finally able to find a download. https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes This is the only place I could find a copy of the 2017 Community Edition. I have not been able to find a copy of just the build tools though.@jaray200 you can use the 2019 build tools with a 2017 Qt version. MSVC 2017 will be dropped soon anyway, as its buggy.
Regards
-
wrote on 1 Apr 2020, 22:52 last edited by
You can configure Qt Creator's compiler to pick up vs2017 compiler installed with VS2019 build tool by passing "amd64 -vcvars_ver=14.16.27023" arguments to the "Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" script.