Error C1189 MFC

I already searched for solutions on the Internet, but nothing helped me. I want to encode a simple chat in C ++, everything is fine, but I get this error:

bug C1189: #error: building a MFC application with / MD [d] (version of the CRT DLL) requires a version for the MFC shared libraries. Please #define _AFXDLL or do not use / MD [d]

I have already identified

#define _AFXDLL 

but the error is still happening. Any help would be appreciated!

+5
source share
1 answer

There are two parameters that must be consistent with each other:

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

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

If they do not agree, you will receive the error message that you indicated.

+10
source

Source: https://habr.com/ru/post/1204022/


All Articles