如何修复从VS2010升级到VS2013的项目中的链接错误,链接器正在寻找一个不存在的MFC库文件?

时间:2021-11-27 20:28:14

I am upgrading a VS2010 project to VS2013. One of my applications is looking for mfc120.lib (or mfc120d.lib for debug builds). However, it appears that VS2013 ships with mfc120*u*.lib and mfc120*u*d.lib (presumably unicode versions which is the only version of MFC supported by VS2013).

我正在升级VS2010项目到VS2013。我的一个应用程序是寻找mfc120。*(或mfc120d。调试构建*)。然而,VS2013船只上显示的是mfc120*u*。*和mfc120 *你* d。lib(可能是unicode版本,这是VS2013支持的唯一版本的MFC)。

Here are the linker errors I'm getting:

下面是我得到的链接错误:

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

I'm looking through the project property sheets and don't see any setting for specifying which MFC library file to link against. It's not even showing up in the "Linker-->Command Line" page of the property sheets.

我正在查看项目属性表,并没有看到任何用于指定要链接的MFC库文件的设置。它甚至没有出现在属性表的“链接器——>命令行”页面中。

Can someone help me figure out how to get the project to link to the correct library files?

有人能帮我弄清楚如何让项目链接到正确的库文件吗?

Thank you very, very much!

非常非常感谢!

3 个解决方案

#1


7  

In your compile commandline, there is probably a

在编译命令行中,可能有一个。

/D "_MBCS"

/ D“_MBCS”

and that should be

这应该是

/D "_UNICODE"

/ D“_UNICODE”

That's effectively like putting a

这就像a。

#define _UNICODE

#定义_UNICODE

at the top of your source files, but I think it affects what libraries are pulled in well.

在您的源文件的顶部,但是我认为它影响了哪些库被很好地拉入。

See the MSDN docs for more info.

有关更多信息,请参见MSDN文档。

#2


8  

Sometimes the issue involves code that can't be re-compiled with Unicode support. In that case, download the multi-byte libraries:

有时,问题涉及不能用Unicode支持重新编译的代码。在这种情况下,下载多字节库:

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

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

#3


2  

In VS2013, these are available as addon:

在VS2013中,这些可以作为addon使用:

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

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

#1


7  

In your compile commandline, there is probably a

在编译命令行中,可能有一个。

/D "_MBCS"

/ D“_MBCS”

and that should be

这应该是

/D "_UNICODE"

/ D“_UNICODE”

That's effectively like putting a

这就像a。

#define _UNICODE

#定义_UNICODE

at the top of your source files, but I think it affects what libraries are pulled in well.

在您的源文件的顶部,但是我认为它影响了哪些库被很好地拉入。

See the MSDN docs for more info.

有关更多信息,请参见MSDN文档。

#2


8  

Sometimes the issue involves code that can't be re-compiled with Unicode support. In that case, download the multi-byte libraries:

有时,问题涉及不能用Unicode支持重新编译的代码。在这种情况下,下载多字节库:

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

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

#3


2  

In VS2013, these are available as addon:

在VS2013中,这些可以作为addon使用:

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

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