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

Henry Skoglund henry at tungware.se
Tue Jul 2 07:54:27 CEST 2024


On 2024-07-02 04:55, David M. Cotter wrote:
> 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'

If you compile in Release mode (instead of Debug) and remove the 
appended u, like this:
LIBS += -L$${ALTMFC_PATH}lib\x64 -lmfc140u you still get the same 
LINK1104 error?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240702/60dccf3c/attachment.htm>


More information about the Interest mailing list