Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version

将 VC 中的(MFC)工程移动到 VS2008 中 跑出如下异常:

 

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]   
   

-------------------------------------------------------------------------------------

 

 

Building MFC application with /MD[d] (CRT dll version)requires MFC shared dll version~~~~
2008-11-03 14:24

1>------ 已启动生成: 项目: OSGtest, 配置: Debug Win32 ------
1>正在编译...
1>AddScene.cpp
1>main.cpp
1>c:/program files/microsoft visual studio 8/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]
1>PickHandler.cpp
1>SceneSound.cpp
1>SemSceneSerializer.cpp
1>c:/program files/microsoft visual studio 8/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]
1>XMLSerializer.cpp
1>c:/program files/microsoft visual studio 8/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]
1>正在生成代码...
1>项目 : warning PRJ0018 : 未找到下列环境变量:
1>$(OSGHOME)
1>生成日志保存在“file://d:/vs2005Project/test/OSGtest/OSGtest/Debug/BuildLog.htm”
1>OSGtest - 3 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========


在VS2005下,遇到这个错误。
解决方法:对着你的项目点击右键,依次选择:属性、配置属性、常规,然后右边有个“项目默认值”,下面有个MFC的使用,选择“在共享 DLL 中使用 MFC”,就OK了~~~

 

 

你可能感兴趣的:(Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version)