Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Debugging a Release Build

You can debug a release build.

To enable debugging of a release build, change the following release build options

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. In the C/C++ folder, select the General property page.
  3. For the Debug Information Format property, click Program Database (/Zi).
  4. In the C/C++ folder, select the Optimization property page.
  5. For the Optimization property, click Disabled (/Od).
  6. In the Linker folder, select the Debug property page.
  7. For the Generate Debug Info property, select Yes (/DEBUG).

After doing this, rebuild and test your program. If, at this point, the program works fine, then it is still possible that you have a memory overwrite, but it is also possible that the optimizations are causing problems on a particular piece of code. To isolate that code, see Optimizing Your Code.

The purpose of turning off optimizations is to help you debug the application. With optimizations on, the debugger won't necessarily be able to show you the correct source code and debug information.

You can now debug your release build application. To find the problem, step through the code (or of using Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.

See Also

Fixing Release Build Problems

© 2015 Microsoft