#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 数据绑定(6)自定义绑定方法、双向数据绑定
1.官方文档 https://developer.android.com/topic/libraries/data-binding/binding-adapters https://developer ...
- Java中的IO操作和缓冲区
目录 Java中的IO操作和缓冲区 一.简述 二.IO流的介绍 什么是流 输入输出流的作用范围 三.Java中的字节流和字符流 字节流 字符流 二者的联系 1.InputStreamReader 2. ...
- luogu P3796 【模板】AC自动机(加强版)
知识点:1.一定要删掉调试信息 2.数组别重名 code: #include <bits/stdc++.h> using namespace std; int n; int len[]; ...
- SpringCloud系列之分布式配置中心极速入门与实践
SpringCloud系列之分布式配置中心极速入门与实践 @ 目录 1.分布式配置中心简介 2.什么是SpringCloud Config? 3.例子实验环境准备 4.Config Server代码实 ...
- Tomcat9w.exe无法启动为started
问题: startup.bat可以正常启动,http://localhost:8080/ 可以正常访问.但是Tomcat9w.exe无法启动为started,一直为Stopped. 解决方案: 如下图 ...
- Agumaster页面样式就绪
- mysql通过经纬度查询400公里范围内的小区
mysql距离计算,单位m,以及排序 lng 经度 lat 纬度 一般地图上显示的坐标顺序为,纬度在前(范围-90~90),经度在后(范围-180~180) 传入参数 纬度 40.0497810000 ...
- AWD 第二弹
前言 小组第二次awd训练 万能密码登陆 首页发现一个登录界面,使用万能密码登陆 ' or 1=1#' 登陆成功后,发现Flag 任意文件上传 刚刚的后台界面存在上传按钮,可直接上传一句话木马 文件包 ...
- why哥被阿里一道基础面试题给干懵了,一气之下写出万字长文。
这是why的第 65 篇原创文章 荒腔走板 大家好,我是 why,欢迎来到我连续周更优质原创文章的第 65 篇.老规矩,先荒腔走板聊聊技术之外的东西. 上面这图是去年的成都马拉松赛道上,摄影师抓拍的我 ...
- docker push出现denied: requested access to the resource is denied
今天想再 把本地的docker image 镜像push 到: https://hub.docker.com/ Step1: login : https://hub.docker.com/ [root ...