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

Axel Spoerl axel.spoerl at qt.io
Tue Jul 2 07:56:56 CEST 2024


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-bounces at qt-project.org> im Auftrag von David M. Cotter <dave at kjams.com>
Gesendet: Dienstag, 2. Juli 2024 04:55
An: interest at qt-project.org Interest <Interest at 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:
[cid:62fd74e6-4380-4ea2-9da7-0ff9f4fb21e9 at eurprd02.prod.outlook.com]


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 at qt-project.org
https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240702/9ac48ff2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6255a32a-a8ba-4aa4-b20b-c2999304f1b9.png
Type: image/png
Size: 128903 bytes
Desc: 6255a32a-a8ba-4aa4-b20b-c2999304f1b9.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240702/9ac48ff2/attachment-0001.png>


More information about the Interest mailing list