Sign in to follow this  

VS2005, works in Debug but not Release mode.

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Conner McCloud
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

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.

Share this post


Link to post
Share on other sites
Quote:
Original post by etothex
I would read this, even if you've already checked all those cases maybe it will help you think about what could be wrong.


Thanks, that article was very informative.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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