开发者

VS2008 upgrade to VS2010 "cannot open file 'mfc90d.lib'"

I am trying to upgrade a Visual C++ 2008 project to a Visual C++ 2010 proj开发者_Python百科ect. when the upgrade is finished and I compelled it, I got this error: fatal error LNK1104: cannot open file 'mfc90d.lib'

I think it should reference to "mfc100d.lib", I tried many ways to fix it but failed.

does anyone meet the same problem?


Possible causes include

a) You are not rebuilding all source files - try deleting all output obj and lib to be sure b) You are linking a 3rd party static lib that was built with VC9 - you will need the VC10 version c) Your header paths are pointing at VC9 headers (check your solution's path options) d) Your project includes an explicit reference to mfc90d for some other reason.

Next diagnosis step: set the /verbose option on the linker and work out exactly which obj is dragging in mfc90d.lib.

Martyn


I found the problem to my missing MFC100.dll by doing a global search of all my source files for the definition "_MFC_FILENAME_VER". I found following definition in one of my header files:

#define _MFC_FILENAME_VER 100

which was used in this block:

#ifdef _DEBUG
#pragma comment(lib, "mfc" _MFC_FILENAME_VER "d.lib")
#pragma comment(lib, "mfcs" _MFC_FILENAME_VER "d.lib")
#else
#pragma comment(lib, "mfc" _MFC_FILENAME_VER ".lib")
#pragma comment(lib, "mfcs" _MFC_FILENAME_VER ".lib")
#endif

I changed it to:

#define _MFC_FILENAME_VER 110

so it would compile with VS 2012's version of MFC (mfc110d.lib).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜