SDL2 programs compile but don't run on Windows 7

Hello,

I’m just trying to get SDL2 running on my Windows 7 laptop. I’ve been following the lazyfoo tutorials for windows development using Mingw, since I normally program on Linux. My issue is that his tutorial 1 code will compile perfectly fine, but when I run the executable which is created, there is no absolutely no output.

If executed from within an msys session, sometimes a new console window will pop up quickly and exit, but normally it just has no output and exits normally as far as I can tell. If I run the executable directly, same thing. A console window quickly opens then closes.

I’ve tried putting in cout statements at different points within the program, but it never outputs any of these. I’ve never experienced anything like this before, and I can’t find anything about it online.

I would greatly appreciate any help as this has been bugging me for a few weeks now. I’ve even tried using MSVC 2013, but it has issues of its own as well.

Thanks in advance.

If you run the program from DOS, do you get messages stating that DLL’s are missing ?

I don’t have the laptop with me right now, but I don’t think DOS outputs anything either. Also the dll is in the correct directory.

I presume it is actually crashing in SDL_CreateWindow, rather than returning NULL and there being a problem with, say, SDL_DestroyWindow (although that should check NULL values).

MrTAToad wrote:

I presume it is actually crashing in SDL_CreateWindow, rather than returning NULL and there being a problem with, say, SDL_DestroyWindow (although that should check NULL values).

Yep. It doesn’t get to the check if window is still NULL or not, and gdb won’t step into the function. I tried the code with v2.0.2, and it crashed in the same spot as well.

I’m currently trying to build v2.0.3 myself to see if I can find anything else out.[/img]

I wonder if SDL2 is unable to use either DirectX or OpenGL, reverting to software mode and then crashing for some reason.

MrTAToad wrote:

I wonder if SDL2 is unable to use either DirectX or OpenGL, reverting to software mode and then crashing for some reason.

I think it’s related to that, and possibly how the laptop is setup. This is on my work laptop, which was setup to run a certain way (use certain software only, encryption, and so on). So it maybe doing something which restricts use behind the scenes (not sure, don’t know a lot about Windows 7 OS).

Either way, when I was trying to build the src for 2.0.3, I kept running into an issue where some dxgi.h header file was not found and it would just stop from there. I’ve only found people having problems when they were trying to compile v2.0.2, and those were fixed by them change
Code:
#include <DXGI.h>

to
Code:
#include <dxgi.h>

After that, I was planning on running a VM of Arch and just using that instead, but to my chagrin, it would BSOD my computer as soon as I try running it. I appreciate you trying to help, but I think I’ll just bite the bullet and work on things which only rely on the std c++ libs when I’m bored at work.[/code]

Fair enough!

I believe this is a bug specific to builds with MinGW32. If you install
MinGW-w64, you might be better off until this is figured out.

Jonny DOn Thu, Jan 8, 2015 at 2:46 PM, MrTAToad wrote:

Fair enough!


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

2015-01-08 21:37 GMT-03:00, Jonathan Dearborn :

I believe this is a bug specific to builds with MinGW32. If you install
MinGW-w64, you might be better off until this is figured out.

For what’s worth, SDL2 already had problems with the original MinGW
for quite a long ago (last time I tried, using the threading functions
would result in a linker error, while MinGW-w64 has no such problem).