#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 ...
随机推荐
- android开发之splash闪屏页判断是否第一次进入app代码
package com.david.david.zhankudemo.activity; import android.app.Activity; import android.content.Con ...
- tars 部署
1. mysql url: 192.168.101.3 port: 3306 pw: 123456 一键部署 sudo ./linux-install.sh localhost 123456 en0 ...
- org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed(转)
xml文件不能被正确解析/The processing instruction target matching "[xX][mM][lL]" is not allowed. The ...
- Almost All Divisors(求因子个数及思维)
---恢复内容开始--- We guessed some integer number xx. You are given a list of almost all its divisors. Alm ...
- Linq 下的扩展方法太少了,您期待的 MoreLinq 来啦
一:背景 1. 讲故事 前几天看同事在用 linq 给内存中的两个 model 做左连接,用过的朋友都知道,你一定少不了一个叫做 DefaultIfEmpty 函数,这玩意吧,本来很流畅的 from. ...
- python守护线程t.setDaemon(True)
守护线程是守护主线程 t.setDaemon(True),调用函数里面存在等待时间时,只要设置了守护线程,函数中等待时间下面的代码都不会再执行
- 居然仅用浏览器,就完成了Spring Boot应用的开发与部署!
最近有幸试用了一下阿里云的一个新产品:云开发平台,体验一把全新的开发模式!虽然中间也碰到了一些问题,但整体的体验透露着未来感,因为整个过程都不需要使用我们最常用的IDEA,仅依靠浏览器就把一个Spri ...
- element ui 分页记忆checked
<el-table :data="tableData" border ref="multipleTableChannel" @selection-chan ...
- JVM--先说本地方法接口
本地方法接口 在讲Java虚拟机运行时数据区中本地方法栈之前,我们先来说说运行时数据区之外的一个叫本地方法接口的东西简称JNI(Java Native Interface) 简单来讲,一个Native ...
- 218。重复元素II(重复元素的下标差值<=K)(哈希)
给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j],并且 i 和 j 的差的 绝对值 至多为 k. 示例 1: 输入: nums ...