SDL App 'has stopped working'

Hello everyone!

I’m attempting to make a game using the SDL library, however I’m having some trouble getting my application to run - both on my own computer and on others.’ What’s weird about it, is that my game runs fine when using the debugger of Microsoft Visual C++ 2010, the problem appears when trying to run the executable from outside the IDE.

On my Windows 7 machine the window greys out, another window pops up saying that ‘App.exe has stopped working’, and that ‘Windows is checking for a solution to the problem.’ If I run the application with a compatibility mode of anything from Windows NT 4.0 (SP 5) and onwards the program runs fine.

On my Windows XP machine the application wont open; it says something along the lines of ‘App.exe has encountered a problem and needs to close. We are sorry for the inconvenience.’

The only thing in my project configuration that differs from normal (ie. setting library and include folders, setting additional dependencies and changing subsystem to windows), is that I’ve set Runtime Library to ‘Multi-Threaded /MT’, instead of ‘Multi-Threaded DLL /MD’ - to prevent others from having to install the Visual C++ Redistributable to run the application (I did recompile SDL so it works with this).

Has anyone else experienced something similar – or do you have any idea what this could be happening? If you want me to post some source code, I will, but everything compiles fine and runs fine under some circumstances, so I’m unsure where in the code I could have a problem, hopefully I can get a hint as to where to look.

I did try to search both here on this forum and google, but I didn’t find a solution to my problem - hope someone here can help me.

/Feodor

I suspect the problem is that your program can’t find SDL’s DLL files
(whereas in the IDE, it can find those automatically) - put a copy of
SDL.dll (and whatever other SDL DLL files you’re using) with the executable
file, and things should run just fine.

Take care,
-AlexOn Thu, Aug 26, 2010 at 5:07 PM, feodor wrote:

Hello everyone!

I’m attempting to make a game using the SDL library, however I’m having
some trouble getting my application to run - both on my own computer and on
others.’ What’s weird about it, is that my game runs fine when using the
debugger of Microsoft Visual C++ 2010, the problem appears when trying to
run the executable from outside the IDE.

On my Windows 7 machine the window greys out, another window pops up saying
that ‘App.exe has stopped working’, and that ‘Windows is checking for a
solution to the problem.’ If I run the application with a compatibility mode
of anything from Windows NT 4.0 (SP 5) and onwards the program runs fine.

On my Windows XP machine the application wont open; it says something along
the lines of ‘App.exe has encountered a problem and needs to close. We are
sorry for the inconvenience.’

The only thing in my project configuration that differs from normal (ie.
setting library and include folders, setting additional dependencies and
changing subsystem to windows), is that I’ve set Runtime Library to
’Multi-Threaded /MT’, instead of ‘Multi-Threaded DLL /MD’ - to prevent
others from having to install the Visual C++ Redistributable to run the
application (I did recompile SDL so it works with this).

Has anyone else experienced something similar – or do you have any idea
what this could be happening? If you want me to post some source code, I
will, but everything compiles fine and runs fine under some circumstances,
so I’m unsure where in the code I could have a problem, hopefully I can get
a hint as to where to look.

I did try to search both here on this forum and google, but I didn’t find a
solution to my problem - hope someone here can help me.

/Feodor


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I sometimes get the same thing happening when I try to upload an image that doesn’t exist (if i had misspelled the filename).
So, be sure to have the images along with the .exe, as well as other files you are using to run your program.

Nechs wrote:

I sometimes get the same thing happening when I try to upload an image that doesn’t exist (if i had misspelled the filename).
So, be sure to have the images along with the .exe, as well as other files you are using to run your program.

That could’ve been it. I changed from using BMP files to PNG files and now it works without using compatibility mode on the machine on which I developed it.

Now it works on other machines as it did on the developer machine before: Needs compatibility mode to run, but then it does run (and show all the image files).

I suppose the difference between the machines is that the one where it works on is the one where I developed it, not sure exactly what could be wrong though - any ideas?

/feodor

Were you using SDL_image?

Jonny DOn Sat, Aug 28, 2010 at 2:53 AM, feodor wrote:

Nechs wrote:

I sometimes get the same thing happening when I try to upload an image
that doesn’t exist (if i had misspelled the filename).
So, be sure to have the images along with the .exe, as well as other files
you are using to run your program.

That could’ve been it. I changed from using BMP files to PNG files and now
it works without using compatibility mode on the machine on which I
developed it.

Now it works on other machines as it did on the developer machine before:
Needs compatibility mode to run, but then it does run (and show all the
image files).

I suppose the difference between the machines is that the one where it
works on is the one where I developed it, not sure exactly what could be
wrong though - any ideas?

/feodor


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Jonny D wrote:

Were you using SDL_image?

Jonny D

Yes. The PNG’s are loaded using IMG_Load().

Okay, just making sure you weren’t just using SDL and the app was broken
because of that.

Jonny DOn Sat, Aug 28, 2010 at 1:04 PM, feodor wrote:

Jonny D wrote:

Were you using SDL_image?

Jonny D

Yes. The PNG’s are loaded using IMG_Load().


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

A simple stack trace or a core dump where the application crashes is
pretty vital to real debugging. Try to learn to do that as soon as
possible. I haven’t developed on MSWindows for a decade so I can’t
tell you how to get it, unfortunately.

What exactly is “compatibility mode?”

You’ve been very helpful listing system (OS) software you’ve tried
running on, but have you been observing what kind of CPU architecture
you’re running on? Could “compatibility mode” possibly be the
difference between supporting the instruction set your build is
targeting?

You should also always make sure you know exactly what you’re linking
to. You might find that on systems that work, you’re linking to a
specific build or version of a DSO (DLL) and different ones when it
doesn’t work. On *NIX the “ldd” command will behave as the dynamic
linker and determine what DSOs your app will link to when run with the
same settings you run ldd from. On MSWindows you have Dependency
Walker, a must-have tool for MSWindows developers if things are the
way they were ten years ago!

http://www.dependencywalker.com/

Good luck solving your problem! A stack trace would be very helpful
for others trying to determine the problem.

Also it’s really important that you try to reproduce this problem with
an SDL test application. I would recommend one but I don’t know which
one might use SDL_image. Perhaps there is an SDL_image test app that I
never really noticed that you could use. In any case, you should
quickly determine whether the problem lies in your app, your build
tools, or in SDL or SDL_image!On Thu, Aug 26, 2010 at 5:07 PM, feodor wrote:

Hello everyone!

I’m attempting to make a game using the SDL library, however I’m having some
trouble getting my application to run - both on my own computer and on
others.’ What’s weird about it, is that my game runs fine when using the
debugger of Microsoft Visual C++ 2010, the problem appears when trying to
run the executable from outside the IDE.

On my Windows 7 machine the window greys out, another window pops up saying
that ‘App.exe has stopped working’, and that ‘Windows is checking for a
solution to the problem.’ If I run the application with a compatibility mode
of anything from Windows NT 4.0 (SP 5) and onwards the program runs fine.

On my Windows XP machine the application wont open; it says something along
the lines of ‘App.exe has encountered a problem and needs to close. We are
sorry for the inconvenience.’

The only thing in my project configuration that differs from normal (ie.
setting library and include folders, setting additional dependencies and
changing subsystem to windows), is that I’ve set Runtime Library to
’Multi-Threaded /MT’, instead of ‘Multi-Threaded DLL /MD’ - to prevent
others from having to install the Visual C++ Redistributable to run the
application (I did recompile SDL so it works with this).

Has anyone else experienced something similar – or do you have any idea
what this could be happening? If you want me to post some source code, I
will, but everything compiles fine and runs fine under some circumstances,
so I’m unsure where in the code I could have a problem, hopefully I can get
a hint as to where to look.

I did try to search both here on this forum and google, but I didn’t find a
solution to my problem - hope someone here can help me.

/Feodor


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

SDL_image comes with a sample application named “showimage”. You can try
loading the images that fail in your app with that sample application.

Ken> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Donny Viszneki
Sent: Sunday, August 29, 2010 1:03 AM
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL App ‘has stopped working’.

A simple stack trace or a core dump where the application crashes is
pretty vital to real debugging. Try to learn to do that as soon as
possible. I haven’t developed on MSWindows for a decade so I can’t
tell you how to get it, unfortunately.

What exactly is “compatibility mode?”

You’ve been very helpful listing system (OS) software you’ve tried
running on, but have you been observing what kind of CPU architecture
you’re running on? Could “compatibility mode” possibly be the
difference between supporting the instruction set your build is
targeting?

You should also always make sure you know exactly what you’re linking
to. You might find that on systems that work, you’re linking to a
specific build or version of a DSO (DLL) and different ones when it
doesn’t work. On *NIX the “ldd” command will behave as the dynamic
linker and determine what DSOs your app will link to when run with the
same settings you run ldd from. On MSWindows you have Dependency
Walker, a must-have tool for MSWindows developers if things are the
way they were ten years ago!

http://www.dependencywalker.com/

Good luck solving your problem! A stack trace would be very helpful
for others trying to determine the problem.

Also it’s really important that you try to reproduce this problem with
an SDL test application. I would recommend one but I don’t know which
one might use SDL_image. Perhaps there is an SDL_image test app that I
never really noticed that you could use. In any case, you should
quickly determine whether the problem lies in your app, your build
tools, or in SDL or SDL_image!

On Thu, Aug 26, 2010 at 5:07 PM, feodor wrote:

Hello everyone!

I’m attempting to make a game using the SDL library, however I’m having
some
trouble getting my application to run - both on my own computer and on
others.’ What’s weird about it, is that my game runs fine when using the
debugger of Microsoft Visual C++ 2010, the problem appears when trying to
run the executable from outside the IDE.

On my Windows 7 machine the window greys out, another window pops up
saying
that ‘App.exe has stopped working’, and that ‘Windows is checking for a
solution to the problem.’ If I run the application with a compatibility
mode
of anything from Windows NT 4.0 (SP 5) and onwards the program runs fine.

On my Windows XP machine the application wont open; it says something
along
the lines of ‘App.exe has encountered a problem and needs to close. We are
sorry for the inconvenience.’

The only thing in my project configuration that differs from normal (ie.
setting library and include folders, setting additional dependencies and
changing subsystem to windows), is that I’ve set Runtime Library to
’Multi-Threaded /MT’, instead of ‘Multi-Threaded DLL /MD’ - to prevent
others from having to install the Visual C++ Redistributable to run the
application (I did recompile SDL so it works with this).

Has anyone else experienced something similar – or do you have any idea
what this could be happening? If you want me to post some source code, I
will, but everything compiles fine and runs fine under some circumstances,
so I’m unsure where in the code I could have a problem, hopefully I can
get
a hint as to where to look.

I did try to search both here on this forum and google, but I didn’t find
a
solution to my problem - hope someone here can help me.

/Feodor


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Compatibility mode is a Windows thing. Each version of Windows
changes default system behaviors that some programs rely on, so
they introduce a setting to run older programs under system settings
and behaviors that apply to older versions instead of the new
standard. It has nothing to do with CPU architecture AFAIK.>----- Original Message ----

From: Donny Viszneki <donny.viszneki at gmail.com>
Subject: Re: [SDL] SDL App ‘has stopped working’.

A simple stack trace or a core dump where the application crashes is
pretty vital to real debugging. Try to learn to do that as soon as
possible. I haven’t developed on MSWindows for a decade so I can’t
tell you how to get it, unfortunately.

What exactly is “compatibility mode?”

You’ve been very helpful listing system (OS) software you’ve tried
running on, but have you been observing what kind of CPU architecture
you’re running on? Could “compatibility mode” possibly be the
difference between supporting the instruction set your build is
targeting?