SDL_Init segfault

I’m trying to write a fairly simple program to look for, allow the
selection of, and show the output from, an audio input device. To do
this, I’m using SDL_ShowMessageBox to generate a set of buttons, each
of which corresponds to a detected input device. I’m half-expecting to
run into problems with this… but instead, I’m running into a
segfault in SDL_Init() (previously I was running into it within
another call to the message box function, but I’ve commented that out
for the moment).

Gdb says 0x0*0403a30 in SDL_Init(), specifically.

Build command line is $ g++ -std=c++11 -I/include -L/lib/SDL2_x64
SDL_audioin_demo.cpp -lmingw32 -lSDL2main -lSDL2

Environment is MSys. “g++ -v” produces this passingly-relevant seeming
info info: “gcc version 4.8.1 (tdm64-2)”, which is one of the SEHExcep

Source and dll included below. All SDL libraries were from the
"SDL2-devel-2.0.3-mingw.tar.gz" release (downloaded just a few days

Unfortunately, I’m not certain of how to interpret the segfault.
Execution never seems to reach SDL_InitSubSystem(), but does reach
SDL_Init(), which I was under the impression did nothing BUT call
*SubSystem(). Any tips on further debugging?
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_audioin_demo.cpp
Type: text/x-c++src
Size: 11869 bytes
Desc: not available
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL2.dll
Type: application/octet-stream
Size: 1187840 bytes
Desc: not available