#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
转载:https://www.cnblogs.com/cvwyh/p/10570920.html
错误
在使用VS编译文件时出现了如下错误:
#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.先选择“解决方案管理器”,然后按如下路径:项目-》属性-》C/C++-》代码生成-》运行库,将“多线程调试DLL(/MDd)”改成“多线程(/MT)”或“多线程调试(/MTd)”
实验认证多试几个可解决问题:多线程调试DLL(/MDd)”改成“多线程(/MT)”或“多线程调试(/MTd)” 等。


2.选择“解决方案管理器”,然后按如下路径:项目-》属性-》配置属性-》常规-》项目默认值-》MFC的使用,选择“在共享DLL中使用MFC”(有时并不需要修改)。


3.由错误提示中的:“Please #define _AFXDLL or do not use /MD[d]”,可知还可以定义“#define _AFXDLL”来解决问题。
这种方法是修改 "afx.h" 文件最容易,但需要修改不知道有什么影响。
#ifdef _DLL
#ifndef _AFXDLL
#define _AFXDLL
//#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
#endif
注意事项
1.注意选择“属性管理器”与选择“解决方案资源管理器”选项卡会得到不同的属性页,前者是修改整个VS系统的属性,后者只影响当前项目。
2.这里提供的只是解决这个错误应该修改的3个地方,完全按照上述解决方案,有时候也并不能解决问题。正确的思路是,对前2个方法中提到的选项进行随机组合,并重新编译,尝试是否有错。这是最简单的方法,毕竟每个人配置的环境都不一样。
#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
出现如下错误: fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires ...
- 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 e ...
- VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version
VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll ve ...
- Managed C++ dll: #define _AFXDLL or do not use /MD[ d]?
[问题] Hello all I'm writing a managed C++ dll with will be acting as an intermediate between a lo ...
- 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]
今天在开发过程中遇到了C1189 error.找了好久解决办法,最后自己解决了...... 方法:工程右键->属性 编辑预处理器定义: 再次运行,就解决了.
- Building MFC application with /MD[d] (CRT dll version)requires MFC shared dll version
解决方法:
- vc/atlmfc/include/afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT
环境:win7,64位,vs2012 1> c:/program files/microsoft visual studio 8/vc/atlmfc/include/afx.h(24) : fa ...
- c++MFC工程修改在共享DLL中使用MFC为使用标准Windows库的解决办法
由于创建MFC工程时,默认是在共享DLL中使用MFC,如果将此选项改成使用标准Windows库,会报如下错误 c:\program files\microsoft visual studio 9.0\ ...
- Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. ShareSDK 也有这种错误
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for ...
随机推荐
- SpringBoot事务使用和回滚
Springboot中事务的使用: 1.启动类加上@EnableTransactionManagement注解,开启事务支持(其实默认是开启的). 2.在使用事务的public(只有public支持事 ...
- Google谷歌在根据流量统计分析当年的2008年汶川大地震
这是一张2008年的老图,Google当时的博文说道:"当我们依照惯例整理和分析谷歌搜索引擎的流量数据时,一条从未见过的曲线出现在我们面前.当意识到发生了什么事情时,我们的眼睛湿润了.&qu ...
- unity webview
uniwebview http://uniwebview.onevcat.com/manual Unity3D研究院之在Android中打开WebView(三十) http://www.xuanyus ...
- Lua C API 书籍
https://www.oreilly.com/library/view/creating-solid-apis/9781491986301/ https://www.lua.org/notes/lt ...
- 想在java接口自动化里用上Python的requests?这样做就可以了
相信现在很多的公司自动化测试重点都在接口层,因为接口测试更加接近代码底层,相对于UI自动化,接口自动化有着开发更快.覆盖更全.回报率高等优点. 接口自动化代码实现不难,本质上就是代码模拟发送请求,然后 ...
- 不支持原子性的 Redis 事务也叫事务吗?
文章收录在 GitHub JavaKeeper ,N线互联网开发必备技能兵器谱 假设现在有这样一个业务,用户获取的某些数据来自第三方接口信息,为避免频繁请求第三方接口,我们往往会加一层缓存,缓存肯定要 ...
- bootstrap-table存在合并单元格怎么处理数据
效果如图: js文件如下: $(function () { initTable() $('#load_vip').change(function () { $ .ajax({ type: 'POST' ...
- Oracle数据库正则表达式
正则表达式: 无论是在前端还是后台正则表达式都是一个至关重要的知识点,例如判断一个手机号码输入是否正确,如果使用Java.C或者其他语言进行字符串进行判断,也许写几十行代码都不一定能解决,而且漏洞百出 ...
- 蓝桥杯校内模拟赛Python解答
@ 目录 1. 15.125GB 2. 约数个数 3. 叶结点数 4. 数字9 5. 数位递增的数 6. 递增三元组 7. 音节判断 8. 长草 9. 序列计数 10. 晚会节目单 1. 15.125 ...
- [SSM项目]二-项目设计和框架搭建
一 10个实体类 选择Integer 而不是int的原因 :当值为空时,int类型会自动为其初始化,这是我们不希望的. 二 配置Maven 目录结构: src/main/java:业务代码 src/m ...