My game's exe doesn't exit properly - C++,SDL,VS 2005 EE

Started by
9 comments, last by Evil Booger 16 years, 6 months ago
My program exits properly when it is ran from the VS ide, but when its from my folder it creates a "send or don't send error report". I have everything I need in my folder: 1. The necessary dlls 2. The graphics 3. vcredist The project's configuration is set to "release" and the exe in the folder is the "release" one so I don't know what's wrong. How can I debug the crash if it doesn't show up in visual studio?! Please help.
Advertisement
start commenting out code and keep re-compiling until the error goes away.

IE, simply call winmain and nothing else, let the app start and close. any errors?
if not, continue to the next call/function in your program, but don't let it go any further than that. let the function quit and application quit, any errors.. ?
keep doing this until you turn on a function/code that causes the error when you quit.

using common sense, there is alot of code you can just skip and not worry about it as it shouldn't cause the problem.

it's probably something minor your forgetting, like closing sdl etc.

[Edited by - ViperG on October 12, 2007 8:19:29 PM]
Black Sky A Star Control 2/Elite like game
Aw man, that will take forever. I'll have to comment out the code, compile it, move the exe, and try to build it.

Oh well, I guess I should get to work instead of whining.:)
Another thought I had was to do a debug build and in your initial game loop, throw a delay of maybe 10 seconds. Then start the program and attach the debugger to the process, maybe even set a breakpoint and step through if needed.

Cale
you don't have to do it in sequence.

try to comment out 50% of your code if its possible.

then you know 50% good and 50% bad.

then sort the bad again 50% if you can into 50% 50%.

eventually you will narrow it down to a cpp file or a function.

for example, i would comment out my sdl code first. then see if its sdl.

are you using pointers or linked lists?
Black Sky A Star Control 2/Elite like game
I'm not using pointers or linked lists but I am using classes of classes of classes inherited from a class.
Check the output window in VS and make sure that there are no unusual lines or errors, just to be sure.

See if you can get a debugger running on the process and possibly pinpoint where the problem is.
I didn't know that you could attack a debugger to a program outside of visual studio. Is there a tutorial for that somewhere? :)
Quote:Original post by ViperG
start commenting out code and keep re-compiling until the error goes away.

I think there is some confusion. Are you saying that the Debug configuration runs but the Release configuration does not, or are you saying that it runs in the IDE, but not stand-alone? You need to rule out one or the other.

Try running the debug version standalone. It should provide better information if it crashes.
In the IDE, try setting the "working directory" (in the project options) to the folder that you are trying to run the executable from. That may uncover the problem.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Quote:Original post by Evil Booger
I didn't know that you could attack a debugger to a program outside of visual studio. Is there a tutorial for that somewhere? :)


I am not sure about a tutorial, but it's not really that hard. You will have to use the debug build obviously, but you just go under the Debug menu in Visual Studio 2003/2005 and select the option for attach to process, then select the process you would like to attach to. This is the reason I told you to put a delay in your game start, so you can get the process running and then come in here and attach the debugger. I have used this alot for debugging code in windows services.

Thanks.

Cale

This topic is closed to new replies.

Advertisement