Win32 Debug Target vs. Win32 Release Target
When you build your application, you can choose one of two targets: debug and release. These are the two default targets generated by the MFC Application Wizard. The default project settings are summarized in Table 3-4.
Option | Release Build | Debug Build |
---|---|---|
Source Code Debugging | Disabled | Enabled for both compiler and linker |
MFC Diagnostic Macros | Disabled (NDEBUG defined) | Enabled (_DEBUG defined) |
Library Linkage | MFC Release library | MFC Debug libraries |
Compiler Optimization | Speed optimization (not available in Learning Edition) | No optimization (faster compile) |
You develop your application in Debug mode, and then you rebuild in Release mode before delivery. The Release build EXE will be smaller and faster, assuming you've fixed all the bugs. You select the configuration from the build target window in the toolbar, as shown in Figure 1-2 in Chapter 1. By default, the Debug output files and intermediate files are stored in the project's Debug subdirectory and the Release files are stored in the Release subdirectory. You can change these directories on the General property page in the Configuration Properties folder, which you can access in the project's Property Pages dialog box.
You can create your own custom configurations if you need to, by choosing Configuration Manager from Visual C++ .NET's Build menu.