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 lot of old unmanaged legacy C/C++ and a new C# WPF ui. While trying to compile it I'm getting this error: fatal 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] If I define _AFXDLL under the project properties Preprocessor Definitions I get this error: fatal error C1189: #error: WINDOWS.H already included. MFC apps must not #include <windows.h>
Command line error D8016: '/MTd' and '/clr' command-line options are incompatible The problem seems to be the inclusion of "stdafx.h", which I need for common windows data types I'm going to marshal. What am I doing wrong? |
【答案】
Project + Properties, General. Ensure Use of MFC is set to "Use MFC in a Shared Library".
Managed C++ dll: #define _AFXDLL or do not use /MD[ d]?的更多相关文章
- #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 applicat ...
- 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.找了好久解决办法,最后自己解决了...... 方法:工程右键->属性 编辑预处理器定义: 再次运行,就解决了.
- 其原因可能是堆被损坏,这说明**.exe中或它加载的任何DLL中有Bug
最近在写一个写日志文件的线程时,调用了HeapAlloc/HeapFree 申请/释放堆缓冲内存.调用HeapFree释放有个条件就是,日志的空闲缓冲队列中内存块超过100个.在测试的时候,发现调用H ...
- C++调用C#生成的DLL文件的各种问题
C++调用C#生成的DLL文件: 首先选择建立一个C#的类库,然后再按照需求编写需要的函数 之后,对于C++调用过程需要注意的几点: 1.使用#using <....some.dll>指出 ...
- Error C1189: #error: Please use the /MD switch for _AFXDLL builds
在VS 2013中编译程序时出现错误: 错误提示1: error C1189: #error : Building MFC application with /MD[d] (CRT dll versi ...
- c++MFC工程修改在共享DLL中使用MFC为使用标准Windows库的解决办法
由于创建MFC工程时,默认是在共享DLL中使用MFC,如果将此选项改成使用标准Windows库,会报如下错误 c:\program files\microsoft visual studio 9.0\ ...
- Error C1189: #error: Please use the /MD switch for _AFXDLL builds(转)
原文转自 https://www.cnblogs.com/zwh0214/p/6048360.html 在VS 2013中编译程序时出现错误: 错误提示1: error C1189: #error : ...
- 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 ...
- 共享MFC dULL
>------ 已启动生成: 项目: OSGtest, 配置: Debug Win32 ------1>正在编译...1>AddScene.cpp1>main.cpp1> ...
随机推荐
- jquery json 格式教程
介绍 我们知道AJAX技术能够使得每一次请求更加迅捷,对于每一次请求返回的不是整个页面,也仅仅是所需要返回的数据.通常AJAX通过返回XML格式的数据,然后再通过客户端复杂的JavaScript脚本解 ...
- How to properly set clock speed for STM32F4xx devices
http://stm32f4-discovery.com/2015/01/properly-set-clock-speed-stm32f4xx-devices/ I see that you have ...
- Git+SourceTree使用时出现的问题
今天重新用Git+SourceTree添加代码,出现了很多问题,记录下: 1.安装了我SourceTree后克隆项目,粘贴网址后出现Url不正确的情况. 解决: (寻找了些资料,大仙大部分都是说直接选 ...
- 《Go语言实战》摘录:6.1 并发 - 并行 与 并发
6.1 并行 与 并发
- iOS: 计算 UIWebView 的内容高度
- (void)webViewDidFinishLoad:(UIWebView *)wb { //方法1 CGFloat documentWidth = [[wb stringByEvaluating ...
- C#编程(四十五)----------格式字符串
格式字符串 1.格式化货币(跟系统的环境有关,中文系统默认格式化人民币,英文系统格式化美元) 案例: string str=string.Format("{0:C}",0.2); ...
- C#+arcengine获得栅格数据的像素值(高程)
此文问获得栅格数据的像元值(即高程),有可能部分见解不到位,望大神看到了不惜指教! /// <summary> /// 得到高程(通过像素值) /// </summ ...
- spring boot 之@JsonView 简单介绍
@JsonView是jackson json中的一个注解,spring webmvc也支持这个注解. 这个注解的作用就是控制输入输出后的json. 假设我们有一个用户类,其中包含用户名和密码,一般情况 ...
- 怎样把vector和string数据传给旧的C API
通常情况下.旧的C API使用数组合char*指针来进行数据交换而不是vector或string对象. 这种API还将存在非常长的一段时间,假设我们想有效地使用STL.我们就必须与它们和平共处. ...
- 国家code和区号计算
因为项目中要用到这个功能.实现类似微信注冊时能够选择国家并得到对应的区号.还要推断号码正确与否的正则. 找到了 libPhoneNumber-iOS 标准化电话号码库 https://github.c ...