错误C1189 MFC

MRX*_*RXI 5 c++ dll mfc

我已经在网上搜索过解决方案,但没有任何帮助.我想用C++编写一个简单的聊天,一切都很好,但是我收到了这个错误:

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

我已经定义了

#define _AFXDLL
Run Code Online (Sandbox Code Playgroud)

但错误仍然存​​在.任何帮助都很有意义!

Igo*_*nik 11

有两种设置必须相互一致:

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

如果(1)设置为Use MFC in static library,则(2)必须为Multithreaded (/MT)Multithreaded Debug (/MTd)(在发布和调试版本中,相应地).如果(1)是Use MFC in Shared DLL,那么(2)必须是Multi-threaded DLL (/MD)Multi-threaded Debug DLL (/MDd).

当两人不同意时,您会收到您所显示的错误.