Original Post
🔒 Locked
difference debug & release
Advertisement
The difference is whatever is specified in your Project Properties. You can take advantage of the differences by changing the settings. You can set the debug build to use maximum warning level (even treat warnings as errors), and you can set maximum optimization levels for your release build. You can even create additional configurations.
Quote:
Original post by jazztuffy
Hi can any of you tell me what exactly is the diference between release and debug building in VC++. And how can we take advantage of this difference
All that is above :) Just to add, with standard settings, a big difference is that debug mode adds debug information, which will make your code slower, but will enable your program to tell your debugger what went wrong when it crashes. If a program with (standard) release mode crashes it won't be able to tell you why it crashed (in most cases).
If i'm mistaken, please correct this :)
The debug build:
- Contains information in about where in which file the code was generated from, as well as the names of functions and variables, so the debugger knows what it's looking at.
- Doesn't have any optimizations, so to make it easier to follow in a debugger (otherwise code would execute in the wrong order, variables would be missing, and some things might get skipped all together).
- Has extra runtime checks, like checking things for invalid values, filling uninitialized memory with recognizable patterns, and padding memory with other patterns so it can tell if you've overwritten something you shouldn't have when you go to release it.
- Uses different runtime libraries, dedicated to catching mistakes instead of focusing on speed. (Most non-programmers won't have these libraries, and hence won't be able to run the debug version of your program).
- The contents of any assert macros get evaluated. (These are completely free in the release version, and might even get used to aid in optimization.)
In conclusion:
The debug build is huge, slow, uses libraries your end users probably don't have, and is full of things to help you catch bugs.
The release version is small, fast, and what you should be distributing to end users.
- Contains information in about where in which file the code was generated from, as well as the names of functions and variables, so the debugger knows what it's looking at.
- Doesn't have any optimizations, so to make it easier to follow in a debugger (otherwise code would execute in the wrong order, variables would be missing, and some things might get skipped all together).
- Has extra runtime checks, like checking things for invalid values, filling uninitialized memory with recognizable patterns, and padding memory with other patterns so it can tell if you've overwritten something you shouldn't have when you go to release it.
- Uses different runtime libraries, dedicated to catching mistakes instead of focusing on speed. (Most non-programmers won't have these libraries, and hence won't be able to run the debug version of your program).
- The contents of any assert macros get evaluated. (These are completely free in the release version, and might even get used to aid in optimization.)
In conclusion:
The debug build is huge, slow, uses libraries your end users probably don't have, and is full of things to help you catch bugs.
The release version is small, fast, and what you should be distributing to end users.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement