I am working on a Win32 project in Visual Studio 2010. it is generating an MFC error, the error is given below
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]
IntelliSense: #error directive: WINDOWS.H already included. MFC apps must not #include
My Question is why WIN32 project is generating MFC error, and how should i remove this error, kindly guide me
The problem is that one of the headers you're including is including 'afx.h'. The first thing that header does is check to see if _DLL as been defined and if that's present it looks for _AFXDLL and shows this error message if it's not been defined. Here's the relevant bit from afx.h
#ifdef _DLL
#ifndef _AFXDLL
#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
#endif
#endif
If you don't want to include MFC go to your project properties and under C/C++ -> Advanced switch Show Includes ON to see where afx.h is being included.
Could you try this:
Change
Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library
As
Multi-threaded DLL (/MD)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With