错误C1189 MFC [英] Error C1189 MFC

查看:780
本文介绍了错误C1189 MFC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在网上搜索解决方案,但是没有任何帮助. 我想用C ++编写一个简单的Chat,一切都很好,但出现此错误:

I already searched for solutions online, but nothing helped me. I want to code a simple Chat in C++, everything is fine, but I get this error:

错误C1189:#error:使用/MD [d](CRT dll版本)构建MFC应用程序需要MFC共享dll版本.请#define _AFXDLL或不使用/MD [d]

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]

我已经定义了

#define _AFXDLL

,但仍然发生错误.希望得到任何帮助!

but the error is still occures. Any help is apprecicated!

推荐答案

有两个设置必须彼此一致:

There are two settings that must agree with each other:

(1) Project > Properties > General > Use of MFC
(2) Project > Properties > C/C++ / Code Generation / Runtime Library

如果(1)设置为Use MFC in static library,则(2)必须为Multithreaded (/MT)Multithreaded Debug (/MTd)(分别在Release和Debug版本中).如果(1)为Use MFC in Shared DLL,则(2)必须为Multi-threaded DLL (/MD)Multi-threaded Debug DLL (/MDd).

If (1) is set to Use MFC in static library, then (2) must be Multithreaded (/MT) or Multithreaded Debug (/MTd) (in Release and Debug builds, correspondingly). If (1) is Use MFC in Shared DLL, then (2) must be Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd).

如果两个人不同意,则会显示错误.

When the two don't agree, you get the error you've shown.

这篇关于错误C1189 MFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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