Qt has never linked to MFC.

Perhaps with VS2022, the path to relevant headers and libraries is no longer 
implicitly added to the INCLUDE and LIB environment variables.

Volker


> On 2 Jul 2024, at 07:56, Axel Spoerl via Interest <interest@qt-project.org> 
> wrote:
> 
> Good morning David,
> 
> the problem doesn't reproduce on a fresh Windows VM with VS 2022 installed 
> from scratch.
> As you report to have used VS 2019 until recently, a build tools version 
> mismatch comes to mind.
> 
> Latest build tools can be downloaded 
> here:https://aka.ms/vs/17/release/vs_BuildTools.exe
> 
> When escalating a Qt Forum thread to the mailing list, please add a reference 
> to the thread in your e-mail.
> Saves the time of everyone involved.
> 
> https://forum.qt.io/topic/157515/qt-6-8-0-upgrade-windows-no-longer-links-to-mfc
> 
> Cheers
> Axel
> 
> 
> Von: Interest <interest-boun...@qt-project.org> im Auftrag von David M. 
> Cotter <d...@kjams.com>
> Gesendet: Dienstag, 2. Juli 2024 04:55
> An: interest@qt-project.org Interest <Interest@qt-project.org>
> Betreff: [Interest] Qt 6.8.0 Win: no longer links to MFC ?
>  On Windows, using Qt 6.7.1 (with VS2019), in my project I was able to do this
> > #include <afxwin.h> // MFC core and standard components
> 
> and that header would be "found" by the compiler, and the linker would link 
> to mfc140u(d).lib just fine.
> BUT: When i upgraded to Qt 6.8.0, (meaning i had to upgrade to VS2022), now 
> the compiler is no longer able to "find" afxwin.h, nor link to MFC.  ??!?
> 
> Okay, so, if i now add these lines to my .pro file:
> 
> > versionAtLeast(QT_VERSION, 6.8.0) {
> >        DIR_ALTMFC = C:\Program Files\Microsoft Visual 
> > Studio\2022\Community\VC\Tools\MSVC\14.29.30133\atlmfc\
> > 
> >        INCLUDEPATH += $${ALTMFC_PATH}include
> >        LIBS += -L$${ALTMFC_PATH}lib\x64 -lmfc140ud
> > }
> 
> It will now compile (ie: it FINDS the header file) but it still won't link, 
> says:
> > LINK1104: cannot open file 'mfc140ud.lib'
> 
> note that the LIBS path definitely HAS that .lib file RIGHT THERE:
> <6255a32a-a8ba-4aa4-b20b-c2999304f1b9.png>
> 
> Why did it work without effort in VS2019, but just utterly fails regardless 
> of my solution attempts, with vs2022 ??!?
> why should i have to specify the paths and lib at all? i didn't have to do 
> that when i was on VS2019 ??
> 
> anyone know what's going on here?
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest


_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to