Fatal Error C1189 Please #define _afxdll
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads fatal error c1189: #error: please use the /md switch for _afxdll builds with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Do Not Use /md D
Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:
_afxdll Preprocessor Definition
Sign up Win32 Project Generating MFC error up vote 5 down vote favorite 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
Use Mfc In A Shared Dll
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 c++ visual-studio-2010 visual-studio visual-c++ mfc share|improve this question asked Sep 9 '13 at 6:07 WiXXeY 40631127 One the general property page for the project make sure in the "Use of MFC" millidarcy to darcy field it says "Use Standard Windows Libraries". Otherwise, show the headers you're including. –Retired Ninja Sep 9 '13 at 6:26 I have already done that .. but my problem still persist –WiXXeY Sep 9 '13 at 7:03 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted Could you try this: Change Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library As Multi-threaded DLL (/MD) share|improve this answer answered Feb 6 '14 at 12:40 Cihan T. 5614 add a comment| up vote 7 down vote 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. share|improve this answer answered Sep 9 '13 at 7:47 snowdude 3,15711121 still generating the same error –WiXXeY Sep 9 '13 at 9:38 Yes, until you figure out what is including afx.h you'll get that error. Have you tried lo
it dat i know... some can solve plzz [i][quote][b] /* ----------- Header File : h.h----[/i]-------[/quote]--*[/b]/ #include