Qt 6.8.0 upgrade: (Windows) no longer links to MFC ?
-
yes i should have said that that was the second thing i already tried.
but why should i have to specify the paths and lib at all? i didn't have to do that when i was on VS2019 ??
-
Would you please specify what you mean with 'Qt7' and 'Qt8' - none of them is available anywhere. Do you mean Qt 6.7 and Qt6.8?
Where does ALTMFC_PATH comes from?
And don't ping specific users - at least for me this means I ignore the request directly... -
sorry, i mis-typed, what i mean is 6.7.1 vs. 6.8.0. I have corrected the OP
-
@SGaist do you have any idea? or know who might?
-
@davecotter said in Qt 6.8.0 upgrade: (Windows) no longer links to MFC ?:
do you have any idea? or know who might?
I already told you that this is rude...
And you still did not answer my question...
Where does ALTMFC_PATH comes from?
-
Any time I see spaces in a compiler/linker search path I immediately suggest that inadequate quoting could be part of the problem. See INCLUDEPATH and LIBS.
Does
ALTMFC_PATH
, wherever that comes from, end in a backslash?
ShouldALTMFC_PATH
actually beDIR_ALTMFC
?
IsALTMFC_PATH
a typo forATLMFC_PATH
?
Do you get the same result using/
rather than\
in the paths? -
I can't reproduce the problem with a fresh Windows install and VS 2022.
I suspect that a wrong build tools version is installed.
The latest one is available here: https://aka.ms/vs/17/release/vs_BuildTools.exe. -
I just had a look at my Visual Studio 2022 BuildTools installation, and found out that there is no more
ATLMFC_PATH
:********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.10.3 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'arm64' C:\ $ set | findstr ATLMFC_PATH C:\ $ set | findstr ATLMFC EXTERNAL_INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt LIB=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\ARM64;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\ARM64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\arm64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\arm64 LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\ARM64;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\ARM64;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319 C:\ $
But the
ATLMFC
directory is part of theINCLUDE
andLIB
environment variables, which means that the compiler should find the files without any external configuration.You might have to make sure that Qt Creator has the correct Visual C++ environment variables saved in the Compiler Toolchains.
Go to Edit > Preferences > Kits > Compilers and click on
Remove All
thenRe-detect
and then restart Qt Creator.This will trigger Qt Creator to rerun all
vcvarsall.bat
scripts for Visual C++ and save its environment. -
@davecotter , please make sure that you have actually have MFC installed for Visual Studio 2022 , matching the exact MSVC toolchain/compiler verson. You can see int the Visual Studio Installer that there's a wealth of different packages, for the different MSVC compiler versions / architectures. For me, it's e.g. this package:
-
@cristian-adam said in Qt 6.8.0 upgrade: (Windows) no longer links to MFC ?:
I just had a look at my Visual Studio 2022 BuildTools installation, and found out that there is no more ATLMFC_PATH
So that answers one of my diagnostic questions:
Is
ALTMFC_PATH
a typo forATLMFC_PATH
?Now we just need the OP to engage.
-
My apologies for taking so long to respond, i've had very little time to work on this!
So, the original issue was solved by ensuring the correct version of MFC build tools was installed. With that, no need to specify path in .pro file, nor manually include header path or link to lib. It now compiles and links as expected.
thanks SO much for everyone's hints and help! It has really made a difference!
So, currently, what is NOT expected is this: when i attempt to run the app, it immediately crashes in
mfc140u
:for this, i am 100% mystified. Do any of you amazing Gurus have any other clues?
-dave
(ps: sorry for tagging individuals, i hadn't realized it was frowned upon, and i had missed the warning!)
-
hmm. how do i check what flavor? i'm definitely only building and debugging intel (although i am building it on an ARM computer)
with VS2019, it all "just worked" so i'm not sure what changed when i went to VS2022 ?on mac (building on an ARM computer) i can specify in the QMake panel which "ABIs" i want: x86 and/or ARM, but on windows, there is no such UI switch. i'm not sure where else to look, or how to determine which is being selected when linking?
-
-