Skip to main content
gamedev.net
🔒 Locked

[SDL] Programs close so fast

Started by GutyGu 2 replies 650+ views
Original Post
GutyGu
GutyGu
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
Derakon
Derakon
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
bschneid
bschneid
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.
GutyGu
GutyGu
Thank u! it was a uninitialized variable that was breaking my head. It works now :)

See you and thank u again!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.