Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator)
-
Hi,
So I'm in a situation where I've previously built Qt6.8.1 for windows using MSVC (components installed from Visual Studio 2022 installer).
However my machine had failed windows 11 update meaning a wipe and clean install of a lot of programs to fix numerous issues on the PC.
Fast-forward to now, I'm wanting to rebuild Qt6.8.1 with both debug and release versions after completing my applications upgrade to Qt6 from Qt5.
However I now encounter the below issue:
What I find odd was initially I had the issue where cmake couldn't find the compiler/linker ( as describer here -> https://forum.qt.io/topic/146823/the-cxx-compiler-identification-is-unknown ).
I added the compiler/linker to my system path to get around this (though I don't recall having to do this initially).
PATH -> C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64I then checked my visual studio install options, which seem to include what I believe is needed:
What's odd is I can build my updated project with the Qt6.8.1 kit which uses my previously built from source 6.8.1 libs - Below is my kit from QtCreator:
I'm sure I'm missing something simple here,
-
Why does QtCreator show MSVC 17 when I don't see this version when running cmake from the terminal (it shows MSVC 19 - note running cl only shows one compiler)?
-
Is there anything obviously wrong/missing with the C++ build components in the VS installer?
-
Anybody else experienced the same issue and point me to a solution?
Thanks in advance.
-
-
Hi,
So I'm in a situation where I've previously built Qt6.8.1 for windows using MSVC (components installed from Visual Studio 2022 installer).
However my machine had failed windows 11 update meaning a wipe and clean install of a lot of programs to fix numerous issues on the PC.
Fast-forward to now, I'm wanting to rebuild Qt6.8.1 with both debug and release versions after completing my applications upgrade to Qt6 from Qt5.
However I now encounter the below issue:
What I find odd was initially I had the issue where cmake couldn't find the compiler/linker ( as describer here -> https://forum.qt.io/topic/146823/the-cxx-compiler-identification-is-unknown ).
I added the compiler/linker to my system path to get around this (though I don't recall having to do this initially).
PATH -> C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64I then checked my visual studio install options, which seem to include what I believe is needed:
What's odd is I can build my updated project with the Qt6.8.1 kit which uses my previously built from source 6.8.1 libs - Below is my kit from QtCreator:
I'm sure I'm missing something simple here,
-
Why does QtCreator show MSVC 17 when I don't see this version when running cmake from the terminal (it shows MSVC 19 - note running cl only shows one compiler)?
-
Is there anything obviously wrong/missing with the C++ build components in the VS installer?
-
Anybody else experienced the same issue and point me to a solution?
Thanks in advance.
@Ben-Campbell-Wallis Why do you use MinGW terminal if you're using MSVC compiler? Use the correct MSVC terminal which is preconfigured to use that compiler.
-
-
@jsulm - It's the git bash terminal, which I previously used to build the same version of the sources, see:
I will try it using the native tools command prompt...
-
@jsulm update: So it does indeed configure with success and is now building as we speak.
It's not immediately obvious to me why this worked in the past using the git bash terminal as I don't recall using the native terminal.I will mark your reply as a solution (and I'm glad it was as simple as using the x64 native command prompt).
Any thought on this welcome. -
-
@jsulm update: So it does indeed configure with success and is now building as we speak.
It's not immediately obvious to me why this worked in the past using the git bash terminal as I don't recall using the native terminal.I will mark your reply as a solution (and I'm glad it was as simple as using the x64 native command prompt).
Any thought on this welcome.@Ben-Campbell-Wallis said in Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator):
It's not immediately obvious to me why this worked in the past
As far as I can see you used MinGW in the past, not MSVC.
-
@Ben-Campbell-Wallis said in Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator):
It's not immediately obvious to me why this worked in the past
As far as I can see you used MinGW in the past, not MSVC.
@jsulm On closer review of my past compiling issues I see you're correct. My memory failed me this time, however the conclusion was that the error was between the keyboard and chair.
Thanks for the reply and pointing out the 'wood through the trees'.