Enabling the Debugging Features

Debugging is enabled when your program is compiled with the symbol _DEBUG defined. This is typically done by passing the /D_DEBUG flag on the compiler command line. When you define the _DEBUG symbol, sections of code delimited by #ifdef _DEBUG / #endif are compiled.

You also must link with the debug versions of MFC libraries. Setting the Win32 Debug option in Visual C++ ensures linking with the debug libraries. The debug versions of the library have a “D” at the end of the library name. The static debug version of MFC is named NAFXCWD.LIB, and the static release version (nondebug) is named NAFXCW.LIB. The DLL debug version of MFC is named MFCvvD.LIB, and the DLL release version (nondebug) is named MFCvv.LIB (where vv is the version number).

To enable the debugging features