Segfault in 2.0.3 SDL_Init

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.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_audioin_demo.cpp
Type: text/x-c++src
Size: 12242 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141118/49309fe3/attachment-0001.cpp

Message-ID:
<CABXS6_k3YYFS_P01mPqSrb9xac3P-d094OjRWNcHsEwrUP-qMg at mail.gmail.com>
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++.> Date: Tue, 18 Nov 2014 18:46:19 -0600

From: Jared Maddox <@Jared_Maddox>
To: SDL Development List
Subject: [SDL] Segfault in 2.0.3 SDL_Init