#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 ...
随机推荐
- 利用Python爬虫刷新某网站访问量
前言:前一段时间看到有博友写了爬虫去刷新博客访问量一篇文章,当时还觉得蛮有意思的,就保存了一下,但是当我昨天准备复现的时候居然发现文章404了.所以本篇文章仅供学习交流,严禁用于商业用途 很多人学习p ...
- Vue.$set的使用场景
有这样一个需求,用户可以增加多个输入框可以编辑: 实现的思路很简单,点击增加的时候,往一个数组里面push一条数据即可: <template> <div> <di ...
- Vue.use() 不一样的发现
1.Vue.use()首先是可以接受一个函数 var a = function () { console.log(a)}Vue.use(a) // 没有问题会输出a 2.当这个a上面有install属 ...
- springBoot整合spring security+JWT实现单点登录与权限管理--筑基中期
写在前面 在前一篇文章当中,我们介绍了springBoot整合spring security单体应用版,在这篇文章当中,我将介绍springBoot整合spring secury+JWT实现单点登录与 ...
- Monkey and Banana(dp,求最长的下降子序列)
A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a bana ...
- LaTeX分分钟上手【转】
原文地址:<LaTeX新人教程,30分钟从完全陌生到基本入门> 需要说明的几点: 1.文中说用XeTex,但是我的总是失败(出现!undefined control sequence.), ...
- 不要再纠结css/js/html有没有必要放在WEB-INF下了
原因 首先,css/js/html没有必要放在WEB-INF下. 最终这些会被原封不动的展现在客户端,所以访问安全根本就不会成为问题. jsp放在web-inf下,原因主要有两个 1. 远古时代的模式 ...
- Nice to meet you
Who am i 详情可以参见我的这一篇博文 Why and how 其实之前就想在博客园开创自己的博客了,但是自己之前已经利用自己的GitHub搭建了一个 博客,然后的话自己写的文章即水又不多,说到 ...
- 掌控安全sql注入靶场pass-05
1.判断注入点 1 and 1=1 1 and 1=2 考虑存在布尔盲注 布尔盲注解释 当不能像前面那样直接在网页中显示我们要的数据时就需要用到盲注,来得到数据库之类的名字.基于布尔的盲注就是通过判断 ...
- [算法]类似n sum个数的问题(DP)
题目 求和为target的数组元素组合数,含重复. 例: 输入 arr = { 1, 2, 3, 3, 4 } ,target = 6 输出 4 题解 dp[i][j]代表到数组第i-1个元素,目标和 ...