#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 ...
随机推荐
- codeblocks显示:不支持的16位应用程序 解决办法
我是win10 64位系统,写c++运行就会显示不兼容16位应用程序.以前编出来的exe还能用,今天编出的就炸了. 试了用vs编译.vs能用. 试了网上找的各种解决方案, 360修复, 注册表, 重构 ...
- laravel Application实例化后两个方法
laravel容器初始化registerBaseServiceProviders方法 上篇讲解了laravel容器的基本使用和原理,这篇继续Application构造方法中的registerBaseS ...
- Hihocoder 1116 计算
这题最开始的时候看到线段树吧,没找到好的做法 想了下既然是乘积和 (-) (--) (---) 在脑子里就是这种线条位于各个位置,然后各种长度代表连续的乘积个数 然后把所有情况累加起来,但是并不好算 ...
- Linux服务器关联Git,通过执行更新脚本实现代码同步
1.在Linux服务器安装Git yum install git -y tips: 卸载Git : yum remove git 2.在Linux生成ssh key 1)创建用户 git ...
- 记录call、apply、bind的源码
记录一下call.apply.bind的源码,然后从根本上明白其用法. 都知道call.apply与bind的用法,call(this,...arguments).apply(this,[argume ...
- OpenvSwitch系列之七 meter表限速
Open vSwitch系列之一 Open vSwitch诞生 Open vSwitch系列之二 安装指定版本ovs Open vSwitch系列之三 ovs-vsctl命令使用 Open vSwit ...
- pytorch常用函数总结(持续更新)
pytorch常用函数总结(持续更新) torch.max(input,dim) 求取指定维度上的最大值,,返回输入张量给定维度上每行的最大值,并同时返回每个最大值的位置索引.比如: demo.sha ...
- selenium做UI自动化时,模拟鼠标各种操作的ActionChains的用法
1.selenium做自动化的时候,需要模拟鼠标进行单击.双击.右键.拖拽等操作,selenium提供了ActionChains类来进行处理. 2.执行原理:当你调用ActionChains的方法时, ...
- unittest单元测试执行用例的顺序
打印结果如下:
- [剑指Offer]33-根据后序序列判断是否能组成BST
题目 如题. 题解 从序列第一个大于根节点的值往后都是右子树,判断右子树是否都大于根节点. 然后递归判断左右子树是否是BST 代码 class TreeNode { int val = 0; Tree ...