Sign in to follow this  
CrimsonMemory

SDL: Program works in Debug config, but fails in Release

Recommended Posts

This has never happened to me before: my program runs just perfectly in the debug config, but when I set it to Release config (yes, I put all the settings to match those of SDL, like the multi-threaded DLL and stuff like that), it runs much differently! Let me try to explain. My program is simply a sprite on the screen that moves along with the arrow keys, and when an arrow key is being pushed, the sprite animates. This works correctly in debug, but when I run it in Release, the sprite moves around with the keys, but it doesn't animate! It's so weird that everything works perfectly fine except for that nuance. Really, I'm not sure what kind of source code to give you, because this is such an unusual problem; none of the code is wrong, because it works under Debug, but Release just doesn't like it! Honestly, I don't know the first place to look in my code! I'm honestly thinking of just posting ALL of my code, but that seems immoral. So, has ANYONE ever encountered this sort of situation (that is, the disagreement between Debug and Release configs)? If so, are there any factors I should look into that most often contribute to this sort of problem? I really don't want to resort to posting the entirety of my code (which isn't really all THAT much), but if nobody has run into a problem of this sort before, and it's necessary to post it, I will. PLEASE, just ask, if that's the case. I apologize for all that reading you had to do, so THANK YOU just for reading of my plight, and then thanks in advance for any help I can get out of this. It would be greatly appreciated.

Share this post


Link to post
Share on other sites
I believe the biggest issue Debug->Release is uninitialized variables.

Check for those as the debug version can set them to safe values. The release goes for speed and will just allow you to have uninitialized variables.

Share this post


Link to post
Share on other sites
Boder, that was it! I was stupidly referencing a few class members that had never been initialized! Wow, what a freakin' relief. Thanks a LOT for the help!

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