[Interest] Qt 6.8.0 Win: no longer links to MFC ?

David M. Cotter dave at kjams.com
Tue Jul 2 04:55:32 CEST 2024


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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6255a32a-a8ba-4aa4-b20b-c2999304f1b9.png
Type: image/png
Size: 128903 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240701/5d3c25ad/attachment-0001.png>
-------------- next part --------------


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?


More information about the Interest mailing list