The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Segfault in 2.0.3 SDL_Init
Jared Maddox
Guest

I'm having an... annoying problem. For the last few days I've been
trying to compile SDL programs with a TDM version of GNU g++ on MSys.
Regardless of whether I try the message box functions, or SDL_Init (!)
I'm getting segfaults. I haven't been getting complaints about dynamic
library types either (and GDB says that the current fault is INSIDE
SDL_Init; previous faults eventually resolved to a call to 0x0 ).

I've had the same exact problem with LazyFoo's SDL2 "hello world"
program, so I'm fairly certain that it isn't my code at fault.

I'm linking to the SDL2 static (it is a stub, right?) library, and the
mingw32 library. All SDL libraries are current downloads (I checked
just a few moments ago). I would list the command line, but I
mindlessly closed the window a few minutes ago. I will say that it was
the most minimal command line that I could get it to compile with
(almost entirely include and library stuff).

Has anyone run into this type of problem before? This is quite a
show-stopper for me.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Segfault in 2.0.3 SDL_Init
Jared Maddox
Guest

Quote:
Date: Tue, 18 Nov 2014 18:46:19 -0600
From: Jared Maddox
To: SDL Development List
Subject: [SDL] Segfault in 2.0.3 SDL_Init
Message-ID:

Content-Type: text/plain; charset="utf-8"

I'm having an... annoying problem. For the last few days I've been
trying to compile SDL programs with a TDM version of GNU g++ on MSys.
Regardless of whether I try the message box functions, or SDL_Init (!)
I'm getting segfaults. I haven't been getting complaints about dynamic
library types either (and GDB says that the current fault is INSIDE
SDL_Init; previous faults eventually resolved to a call to 0x0 ).

I've had the same exact problem with LazyFoo's SDL2 "hello world"
program, so I'm fairly certain that it isn't my code at fault.

I'm linking to the SDL2 static (it is a stub, right?) library, and the
mingw32 library. All SDL libraries are current downloads (I checked
just a few moments ago). I would list the command line, but I
mindlessly closed the window a few minutes ago. I will say that it was
the most minimal command line that I could get it to compile with
(almost entirely include and library stuff).

Has anyone run into this type of problem before? This is quite a
show-stopper for me.

Found a solution to my problem, but I have no idea why it works: the
segfault goes away if I compile for 32 bit instead of 64 bit. This is
fine, but does anyone know what would cause this in the first place?
The compiler is TDM, SEH exceptions, 64-bit target, 4.8.1 branch of
g++.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org