fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

 

调试程序时出现以下问题:d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]。

按照提示,作出以下修改:

 fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

 

及添加如下代码 #define _AFXDLL

可是问题没有解决,反而出现以下错误:

1>uafxcwd.lib(afxglobals.obj) : error LNK2001: 无法解析的外部符号 _IID_IWICImagingFactory
1>libcmtd.lib(wincrt0.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用
1>C:\Users\zju\Documents\Visual Studio 2010\Projects\Test1\Debug\Test1.exe : fatal error LNK1120: 2 个无法解析的外部命令

   在查阅相关资料后发现:静态链接mfc库的话,那么运行库也得设置成静态链接。 动态链接mfc库,运行库也得设置成动态链接。撤销以前所做修改,做出如下修改:

 

fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

 

fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

 



fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

上一篇:PyQt(Python+Qt)学习随笔:Qt Designer中QAbstractButton派生按钮部件的shortcut 属性


下一篇:js判断是Android还是iOS