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了~~~

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值