Debug - Release

Started by
4 comments, last by Sandman 18 years, 10 months ago
What should i do to compile program using release set... i had build it using setting in debug mode... and the program run succesfully but when i try to use release mode.. there are error, i'm pretty sure not a single code missing in file.... so why it can be happen ? how can i fix it ?
Advertisement
We'll need to see some code. To be honest, it could be anything.

When you run a program in Debug mode, certain things are different than in Release mode. There'll be somebody here who can be more helpful, that's all I know, but you do need to be more specific.

What errors are you getting? When and how are they occurring?

HTH,

ukdeveloper.
Please provide a bit more detail with your questions - with so little information it's hard to do much more than guess what the problem is. What kind of errors are you getting? Compiler errors? Linker errors? Run time errors? What are the error messages? What compiler are you using?

My guess is that you're getting something like "LNK2001: Unresolved External blah blah blah". In which case, the release configuration is missing some library files. Assuming your using MSVC.Net, go to project->properties->linker->input and make sure that the list of libraries in the additional dependencies box is the same for both Debug and Release configurations.
A common error is to have something like that in your code:

assert( somefunction() );

which compiles to nothing in release mode.

there's a lot of possible reasons why it's not working in release-mode, and they are all most likely due to a bug in your code. bugs that don't reproduce in debug-mode are usually related to stuff like pointers not being initialized etc. the debug-crt in msvc initialize all allocated memory to something like 0xCDCDCDCD (don't quite remember, but you'll recognize it easily). anyway, just try removing parts of your program until you find out what part cause the bug or something. i know, it's a pain in the ass, but un-reproducable bugs usually simply are ;)
Quote:Original post by kusma
anyway, just try removing parts of your program until you find out what part cause the bug or something. i know, it's a pain in the ass, but un-reproducable bugs usually simply are ;)


If it's a run time problem, you could go around deleting chunks of your program, recompiling and running until it doesn't crash...

Or you could use the debugger. [grin]

This topic is closed to new replies.

Advertisement