错误 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.
相关文章