[SDL] Programs close so fast

Started by
2 comments, last by GutyGu 17 years, 9 months ago
Hi there! I've a question that maybe is a little idiot :P There are some programs that, when I compile them, I try to run them but they close so fast. But when I push on the "debug" button.. they work! I'm using Dev-C++ 4.9.9.2. What's going on? Thanks a bunch
Advertisement
Sounds to me like you have a memory problem; one common symptom of those types of problems is that they work fine in Debug mode but not in Release mode, or vice versa. Check to make certain you aren't trying to use uninitialized values anywhere.

Also, if you add logging to your program, then you'll have a better idea of what it's doing even if it exits. My programs generate copious logs; while I can always remove them later, they're very helpful during the development process.
Jetblade: an open-source 2D platforming game in the style of Metroid and Castlevania, with procedurally-generated levels
I'd say that there is either a problem with your game loop or you are raising an access violation because you are using a "bad" variable, as Derakon said. SDL makes a text file of the error (I think) in the folder with the .exe, so check there.
Thank u! it was a uninitialized variable that was breaking my head. It works now :)

See you and thank u again!

This topic is closed to new replies.

Advertisement