• 12
• 12
• 9
• 10
• 13

VS2005, works in Debug but not Release mode.

This topic is 4499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Fleurin works fine in debug, but a few nights ago I wanted to test recent changes to it on a friends computer (Which didn't have VS2005). I switched my compilation to "Release" configured the project settings to use the libs/char set as the debug mode, and alas it doesn't work. The code compiles but the execution of it is messed, dispite being a loop variable, variable A won't change values; characteristic of hella stack/buffer corruption. I do use asserts, and I have checked to make sure they arn't the source of problems... Unless of course, the code below is a source of problems...
if(1)
{assert("This is true" && 0);}
What could be causing this? My game works perfectly in Debug...

Share on other sites
Errhmmm....

I did this... (Disabled optimization)

... and the problems went away. Anyone mind explaining this one to me...

Share on other sites
In my experience this is ALWAYS caused by a bug in your code. My best guess in that case would be an uninitialized variable. I do most of my programming on Linux these days so I'd just Valgrind it (no, I can't stop mentioning Valgrind, I've never seen anything else remotely that useful). Otherwise you're pretty much on your own and just going to have to debug it obsessively until you find the bug.

Share on other sites
<sigh>
Porting Fleurin to C# (Using DirectX9) is looking really tempting right now.

To get back on topic though, my code gives 0 Warnings. I have no idea where to begin looking.

Share on other sites
You can debug a release mode application. The line numbers don't match up, but you can still watch variables and set breakpoints. I think this will also prevent your ASSERTs from being compiled away, but don't quote me.

CM

Share on other sites
Quote:
 Original post by Conner McCloudYou can debug a release mode application. The line numbers don't match up, but you can still watch variables and set breakpoints. I think this will also prevent your ASSERTs from being compiled away, but don't quote me.CM

You can add debug information to release builds as well. Some plugin development (e.g. 3DS Max) even requires this, since the plugins only work when linked against the release libraries. I sometimes use such "hybrid" configurations, too. You can create them by creating a new config and inherit settings from your release configuration.
Just add debug information and you are able to step through your code as usual. I'm not sure, but I think asserts are removed anyway.

Quote: