SDL2 programs compile but don't run on Windows 7 |
MrTAToad
|
If you run the program from DOS, do you get messages stating that DLL's are missing ?
|
|||||||||||
|
SDL2 programs compile but don't run on Windows 7 |
neoaggelos
|
Try copying the SDL dll in your program's directory
-- Aggelos Kolaitis On Jan 3, 2015 1:08 PM, "MrTAToad" wrote:
|
|||||||||||||
|
PPeter
|
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.
|
|||||||||||
|
mr_tawan
|
I'd suggest you to try using MSYS2 + Mingw64 build of SDL. In MSYS2, you can install the toolchain + SDL2 library by :
replace i686 with x86_64 for 64bit version . But before that, why won't you tell us what is the code you're working with. Probably it just failed to load some image resource file and that error is not handled properly . If you're using some resource loading function (eg. IMG_Load()) please double check if the resource file is in the correct path. |
|||||||||||||
|
SDL2 programs compile but don't run on Windows 7 |
neoaggelos
|
Furthermore, consider using SDL_Log instead of cout.
cout << "hello"; SDL_Log("hello"); I remember having some issues with cout+SDL a while back, and using SDL_Log() resolved them |
|||||||||||
|
mr_tawan
|
I've just looked at the tutorial. From the code the expected output would be to have a window with 640x480 display area shows up for 2 seconds. The display area of the window would be painted in white.
Do you have anything of those shows up ? Have you put some debugging text in between lines of code ? Is there anything shows up in the console ? |
|||||||||||
|
PPeter
|
Here's the code for others to reference (sorry I didn't put it up in the first place)
I just remembered that gdb is already installed, so I ran the program through that and found out that it runs into a seg fault at:
For some reason, it doesn't say anything when a sig fault occurs. I checked before that line to make sure that everything was initialized properly using SDL_WasInit, it said everything was fine. |
|||||||||||||||||
|
MrTAToad
|
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).
|
|||||||||||
|
PPeter
|
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] |
|||||||||||||
|
MrTAToad
|
I wonder if SDL2 is unable to use either DirectX or OpenGL, reverting to software mode and then crashing for some reason.
|
|||||||||||
|
PPeter
|
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
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] |
|||||||||||||||||
|
MrTAToad
|
Fair enough!
|
|||||||||||
|
SDL2 programs compile but don't run on Windows 7 |
Jonny D
|
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 D On Thu, Jan 8, 2015 at 2:46 PM, MrTAToad wrote:
|
|||||||||||||
|
SDL2 programs compile but don't run on Windows 7 |
Sik
|
2015-01-08 21:37 GMT-03:00, Jonathan Dearborn:
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). _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|