Error C1189 MFC(错误 C1189 MFC)
问题描述
我已经在网上搜索过解决方案,但没有任何帮助.我想用 C++ 编写一个简单的聊天,一切都很好,但我得到了这个错误:
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 C1189 MFC
- Stroustrup 的 Simple_window.h 2022-01-01
- STL 中有 dereference_iterator 吗? 2022-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 从python回调到c++的选项 2022-11-16
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 近似搜索的工作原理 2021-01-01
- C++ 协变模板 2021-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07