How to fix a linker error in a project upgraded from VS2010 to VS2013, where the linker is looking for an MFC library file that isn't there?

I am updating the VS2010 project to VS2013. One of my applications is looking for mfc120.lib (or mfc120d.lib for debug builds). However, it seems that VS2013 comes with mfc120 * u * .lib and mfc120 * u * d.lib (presumably the Unicode version, which is the only version of MFC supported by VS2013).

Here are the linker errors that I get:

LINK : fatal error LNK1104: cannot open file 'mfc120.lib'
LINK : fatal error LNK1104: cannot open file 'mfc120d.lib'

I look through the project property sheets and see no settings to indicate which MFC library file I want to link to. It does not even appear on the Linker → Command Line page of the property sheets.

Can someone help me figure out how to get the project to reference the library files I need?

Thank you very much!

+4
source share
4 answers

Your compiled command line probably has

/D "_MBCS"

and it should be

/D "_UNICODE"

It's effective how to put

#define _UNICODE

at the top of the source files, but I think it affects the way libraries are pulled out well.

See MSDN docs for more information .

+7
source

Sometimes the problem is with code that cannot be recompiled with Unicode support. In this case, download the multibyte libraries:

http://www.microsoft.com/en-us/download/details.aspx?id=40770

+9
source

In VS2013, they are available as an addon:

http://msdn.microsoft.com/en-us/library/dn251007.aspx

+2
source

Perhaps this is due to the lack of MultiByte MFC library. Try installing it at the following link. https://www.microsoft.com/en-us/download/confirmation.aspx?id=40770

0
source

All Articles