In C++, most of the libs come in Debug/Release versions. Question 1. What are the big difference between Debug and Release versions (e.g. what advantages do you have using one versus the other).
Question 2. A lib is just has an implementation of the functions, how does a function implementation change if you are using debug/release versions?
Question 3. Can you ever build your app in debug mode and use a release version of a lib?
Thanks.
#ifdef DEBUG
blockDebug versions are usually built with very few optimizations on -- therefore when you step through them in a debugger with source, there is a good chance that there is a good mapping between source line and what's going on in the program. When you step through highly optimized code, it doesn't map back to source very well, and is harder to debug.
Also, whenever someone uses an #ifdef DEBUG
or equivalent, that code isn't there in the release version (of course). This could be extra error checking, logging, asserts, etc.
Normally, the interface of the function shouldn't be different between debug and release, so you can normally link debug and release together without much trouble.
However, there are some cases (especially on Windows) that it becomes very difficult because of DLL loading built into some libs. Some may try to load debug versions of DLL's and some might want release. These can't both be loaded into the same process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With