Discussion Locked

VC++ : From Debug to Release

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

What steps should be done when moving from Debug to Release application:
1. at the Compiler& env. level
2. at the code level - what adjustments should be done

1 reply

by c-wundram

The compiler and preprocessor are designed to handle code level differences between debug and release builds automaticlly. in a debug build _DEBUG will be defined automaticlly by the preprocessor. So any "ASSERT" macros will resolve to assertions in debug builds and to nothing in release builds.

Besides assertions, you might added other debug code, such as heap checking, calls to OutputDebugString() or DebugBreak(), these should be put inside of a "#ifdef _DEBUG / #endif" so they will notappear in a release build.

At the compiler level you want to enable optimaizations for a release build, usally the /Os (optimize for size) is what you want. Also it is usally a good idea to go ahead and build a pdb file for release builds (/Zi) to help debug problems that can only be reproduced in the release build.

This discussion is closed to new replies.