I’ve Win32 DLL application. Debug build is selected. I wrote such code:
#if DEBUG
fflush(logFile);
#endif
But fflush(logFile); is grayed out so I assume it will not be executed.
But i want it to be executed. Does it mean that in Debug DEBUG symbol is not defined? Where can I define it in VS2012?
Preprocessor definitions are defined under project settings as shown on screenshot (note
_DEBUGthere):Note that in case of
_DEBUGyou want to check if it is defined at all, and not compare it (possibly missing definition) to zero. You want:#if defined(_DEBUG)or
#ifdef _DEBUG