Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error C1189 MFC

Tags:

c++

dll

mfc

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:

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]

I already defined

#define _AFXDLL

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

like image 440
MRXI Avatar asked Oct 04 '14 21:10

MRXI


1 Answers

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

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.

like image 57
Igor Tandetnik Avatar answered Oct 23 '22 09:10

Igor Tandetnik