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".
最新文章
- [Java入门笔记] Java语言基础(三):运算符
- ICEM(2)—机翼翼稍网格绘制
- datatables中columns.render的使用
- WebKit渲染基础(转载 学习中。。。)
- .net matlab 数据类型转换
- hdu 1042 N!
- Window 添加定时任务
- Lua学习笔记(二):基本语法
- vs2012如何创建报表
- eclipse 项目报错问题
- bzoj3230
- 关于 Swift
- redis源码分析之事务Transaction(上)
- Zabbix监控之迁移zabbix server
- oracle:批量插入不同方案对比
- Android P新功能特性抢先看
- Ibatis和Hibernate的比较
- hbuilder 个推 问题记录
- 2018牛客暑期ACM多校训练营第二场(有坑未填)
- SQL SERVER EXPRESS 连接字符串