"Debug" and "Release" are actually just two labels for a whole slew of settings that can affect your build and debugging.
In "Debug" mode you usually have the following:
Program Debug Database files, which allow you to follow the execution of the program quite closely in the source during run-time.
All optimizations turned off, which allows you to inspect the value of variables and trace into functions that might otherwise have been optimized away or in-lined
A _DEBUG preprocessor definition that allows you to write code that acts differently in debug mode compared to release, for example to instrument ASSERTs that should only be used while debugging
Linking to libraries that have also been compiled with debugging options on, which are usually not deployed to actual customers (for reasons of size and security)
In "Release" mode optimizations are turned on (though there are multiple options available) and the _DEBUG preprocessor definition is not defined. Usually you will still want to generate the PDB files though, because it's highly useful to be able to "debug" in release mode when things are running faster.
Also note that when using MFC for example, debug projects link against non-redistributable DLL versions like MFC90D.DLL while release builds link against the redistributable versions like MFC90.DLL.
This is probably similar with other frameworks.
Therefore you will probably not be able to run debug-build applications on non-development machines.
If you go through project compile options and compare them, you'd see what are the differences.
Assuming the question is about native/C++ code (it's not entirely clear from the phrasing):
Basically, in Debug all code generation optimizations are off. Some libraries (e.g. STL) default to stricter error checking (e.g. debug iterators). More debugging information is generated (e.g. for "Edit and Continue"). More things are generated in code to catch errors (local variable values set to uninitialized pattern, debug heap is used).
"Debug" and "Release" are actually just two labels for a whole slew of settings that can affect your build and debugging.
In "Debug" mode you usually have the following:
In "Release" mode optimizations are turned on (though there are multiple options available) and the _DEBUG preprocessor definition is not defined. Usually you will still want to generate the PDB files though, because it's highly useful to be able to "debug" in release mode when things are running faster.
Also note that when using MFC for example, debug projects link against non-redistributable DLL versions like
MFC90D.DLL
while release builds link against the redistributable versions likeMFC90.DLL
. This is probably similar with other frameworks.Therefore you will probably not be able to run debug-build applications on non-development machines.
Mostly, debug includes a lot of extra information useful when debugging. In release mode, this is all cut and traded for performance.
If you go through project compile options and compare them, you'd see what are the differences.
Assuming the question is about native/C++ code (it's not entirely clear from the phrasing):
Basically, in Debug all code generation optimizations are off. Some libraries (e.g. STL) default to stricter error checking (e.g. debug iterators). More debugging information is generated (e.g. for "Edit and Continue"). More things are generated in code to catch errors (local variable values set to uninitialized pattern, debug heap is used).