Sign in to follow this  
Evil Booger

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

Recommended Posts

Evil Booger    100
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.

Share this post


Link to post
Share on other sites
ViperG    206
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]

Share this post


Link to post
Share on other sites
windozer1    133
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

Share this post


Link to post
Share on other sites
ViperG    206
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?

Share this post


Link to post
Share on other sites
WarGames    138
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.

Share this post


Link to post
Share on other sites
JohnBolton    1372
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.

Share this post


Link to post
Share on other sites
windozer1    133
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

Share this post


Link to post
Share on other sites
Evil Booger    100
@JohnBolton
It worlks in the ods but not standalone. The program doesn't start at all if I use the exe from the debug folder. And about the working directory suggestion, when you say project options, do you mean project properties, or the actual options menu because I can't it in either. :)

@windozer1
I can't find the debug build, what sub folder should it be in?



And to everyone, thank you so much for helping me even though I seem useless and unable to find anything. :)

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