Sign in to follow this  
Eralp

Build configurations in vc++

Recommended Posts

Hi, I am now creating a project and these build configurations messed up my mind. My first question is what would be if I "release"(this doesnt refer to configuration =) ) my project in debug mode ? And the second is;I want to compile it in release configuration, I open build->batch build. there are 2 options one is debug and one is release, I unchecked the debug. I compiled it in release and now I can start debugging the release mode. My mind is really messed up as you can see, so can somebody clarify what do they stand for? How I am able to debug the release mode, and if so what is different between release and debug modes.should I be using debug libraries when debugging the release mode .. you know =) edit: And I can run in release mode with including some debug libraries, would this cause problems? [Edited by - Eralp on May 1, 2009 2:53:07 AM]

Share this post


Link to post
Share on other sites
The difference between Debug and Release is rather arbitrary. You can debug anything you like, but a Debug build usually includes extra debugging information and disables optimization which makes it easier. For example, in Release mode, the compiler might inline a function (basically, copying the contents of the function to the call site) that means you won't be able to "step into" that function call (because it's not there anymore).

Additionally, in Visual C++ at least, a Debug build also links to the debug runtime libraries. The debug runtime libraries include extra error checking and debugging information, etc.

You can't "release" a debug build because those debug runtime libraries I mentioned are not allowed to be redistributed with your application (as per the Visual Studio license agreement).

Share this post


Link to post
Share on other sites
Thanks for your answer but I didn't mean using the default "debug" libraries, I am using a custom gui library and I asked what if I use their debug libraries with release configuration and publish it?(That should be my problem since I couldn't explain myself clearly)

1.Would there be any program-based errors or problems, or maybe optimization problems?
2.Should I talk them if I allow to do this?

Share this post


Link to post
Share on other sites
Depending on the libraries, you MIGHT be able to link to debug versions with your release build, you might not. In the case of a static .lib/.a file you have to deal with the fact that it expects to be linked against other debug libraries. And you can't link against two versions of the same library because it confuses the linker (same symbols exist in both, so what one should it use?). So your gui library in debug will want to link against the debug C-Runtime-Library(CRT), but your program in release will want to link against the release CRT.

You probably do NOT want to release your "debug" builds but a stable optimized "release" build linking to all the release libraries. Debug builds are much easier to debug, but also MUCH slower, thus you want to give others the much faster running release builds. But be warry. Release builds may crash when debug builds don't. That is NOT a reason to give out the debug build, it is reason to try and debug the crash and fix the problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this