Debug/Release?

Hi, anyone know what's the different between debug version and release version in MsVS 2010? And also how to get both of them? Thanks :)
The main difference is the (default) debug configuration generates debug information for your program and disables compiler optimizations while the (default) release configuration enables compiler optimizations.

I say 'default' above because you can change the configurations as you see fit. For instance, you can make it so the debug configuration doesn't generate any debug info (doesn't make sense, but you can) and you can make it so the release configuration disables optimizations.

And also how to get both of them?

1) Switch to the debug configuration and build your program.
2) Switch to the release configuration and build your program.

The .exes will be in the output directory (Configuration Properties->General->Output Directory) specified in the project settings for the corresponding configuration.
Last edited on
Hi, thanks for explanation,

So, what's the main different between debug and release?

For example like, is that the .exe from debug/release can be run directly without the need of dll? I'm still confuse with this, thanks :)

Also, $(SolutionDir)$(Configuration)\
I got this in Output Directory, what's does that means? TQ
Last edited on
The debug binaries (.exe) tend to be huge. However, if you crash something it can be easier to track by using a debug instance of visual studio. Also, you can run through your code bit by bit by hitting F5 (or is it F7) after you insert breakpoints in debug.

The release binaries are smaller as they don't have the debug information, however if you have a crash, you won't be able to gather as much information.
Use Release build when you finish your project, is that simple.

you can buld your project in many different ways, for example:
-static build
-dynamic build

-debug
-release

-x64 platform
-x86 platfom

-etc...

To see full information MSDN is your friend:
http://msdn.microsoft.com/en-us/library/ms235630(v=vs.80).aspx
For example like, is that the .exe from debug/release can be run directly without the need of dll?

If you don't want to ship your .exe with the runtime dll, then the option is under Configuration Properties->C/C++->Code Generation->Runtime Library. Switch it to Multi-threaded as opposed to Multi-threaded DLL.

Also, $(SolutionDir)$(Configuration)\
I got this in Output Directory, what's does that means?

Say your .sln is at C:\projects\myproject\my.sln and say you're building with the Release configuration, then $(SolutionDir)\$(Configuration) would become C:\projects\myproject\Release. If you're building with the Debug configuration, then it would become C:\projects\myproject\Debug.
Also, debug builds link to a 'debug heap' to help you track memory leaks.
@kbw

I think that's a Code::Blocks GCC special. I've never seen this sort of option on VS2010.
I think that's a Code::Blocks GCC special. I've never seen this sort of option on VS2010.
It's there.
Thanks everyone, so, to create .exe, which one will be the best if I wanted to run ONLY .exe file in other computer without any other file? Release or Debug version? Thanks :)
@atjm88
To run finished exe file on another computer without any other file needed you will build you project with these settings:
release and static.
Thanks codekiddy,

I can only find the "Release" button on the top bar inside VSC++ 2010 but can't find the static, can I know what "static" u mean? Thanks :)
Topic archived. No new replies allowed.