错误请 #define _AFXDLL 或不使用/MD[d] 即使在项目属性中进行更改后也会发生 [英] error Please #define _AFXDLL or do not use /MD[d] occurs even after making changes in Project Properties

查看:55
本文介绍了错误请 #define _AFXDLL 或不使用/MD[d] 即使在项目属性中进行更改后也会发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 2011 中处理 Win32 项目.当我包含 afx.h 或 afxwin.h 时,它会生成 MFC 错误.为了解决这个问题,我在项目属性选项卡中进行了以下更改:1)MFC的使用:在共享DLL中使用MFC2) C++ -> 代码生成 -> 运行库 -> 多线程调试DLL(/MDd)

I am working on Win32 project in Visual Studio 2011. It is generating MFC error when I includes afx.h or afxwin.h. To resolve this, I have made the following changes in the Project Properties tab : 1) Use of MFC : Use MFC in a shared DLL 2) C++ -> Code Generation -> Runtime Library -> Multi-threaded Debug DLL(/MDd)

当我构建解决方案时它仍然给我以下错误:

Still it gives me following error when I build the solution :

1>C:Program Files (x86)Microsoft Visual Studio 11.0vcatlmfcincludeafx.h(24): 致命错误 C1189: #error : Building MFC application with/MD[d](CRT dll 版本)需要 MFC 共享 dll 版本.请#define _AFXDLL 或不要使用/MD[d]

我的问题是为什么 Win32 项目会产生 MFC 错误,我应该如何消除这个错误.请指导我.

My question is why Win32 project is generating MFC error and how should I remove this error.Kindly guide me.

推荐答案

在 Visual Studio 2011 上,这对我有用:

On Visual Studio 2011, this worked for me:

项目 ->项目"属性->配置属性->一般->项目默认值 ->MFC 的使用:在共享 DLL 中使用 MFC

(在Visual Studio 2019中,后一种设置可以在属性->配置属性->高级->使用MFC"中找到

(In Visual Studio 2019, the latter setting can be found in "Properties -> Configuration Properties -> Advanced -> Use of MFC"

这篇关于错误请 #define _AFXDLL 或不使用/MD[d] 即使在项目属性中进行更改后也会发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆