Building SDL2 r8112 with MinGW

Trying to build subj revision without Direct3D and with OpenGL only
Using CMake generated makefiles for MinGW I get this output:


Linking C shared library libSDL2_d.dll
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script CMakeFiles\SDL2.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\SDL2.dir/objects.a
C:\devtools\qt-52-creator-300\Tools\mingw48_32\bin\ar.exe cr CMakeFiles\SDL2.dir/objects.a @CMakeFiles\SDL2.dir\objects1
C:\devtools\qt-52-creator-300\Tools\mingw48_32\bin\gcc.exe -shared -o libSDL2_d.dll -Wl,–out-implib,libSDL2_d.dll.a
-Wl,–major-image-version,2,–minor-image-version,0 -Wl,–whole-archive CMakeFiles\SDL2.dir/objects.a -Wl,–no-whole-ar
chive -lm -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion -luuid -lmingw32 -mwindows -lkernel32 -luser32 -
lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
CMakeFiles\SDL2.dir/objects.a(SDL_dynapi.c.obj): In function SDL_DYNAPI_entry': c:\projects\jxn\jxnn-lib\ext\src\sdl-r8112\~cmake-mingw-debug/../src/dynapi/SDL_dynapi_procs.h:73: undefined reference t oSDL_RenderGetD3D9Device_REAL’
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [libSDL2_d.dll] Error 1
make.exe[2]: Leaving directory c:/projects/jxn/jxnn-lib/ext/src/sdl-r8112/~cmake-mingw-debug' make.exe[1]: *** [CMakeFiles/SDL2.dir/all] Error 2 make.exe[1]: Leaving directoryc:/projects/jxn/jxnn-lib/ext/src/sdl-r8112/~cmake-mingw-debug’
make.exe: *** [all] Error 2

Maybe I did something wrong? Any suggestions?

Maybe I did something wrong? Any suggestions?

I just pushed a fix for this.


There is another error, on this time it is on compilation stage (


[ 36%] Building C object CMakeFiles/SDL2.dir/src/render/direct3d/SDL_render_d3d.c.obj
C:\devtools\qt-52-creator-300\Tools\mingw48_32\bin\gcc.exe -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -g -O3 -mfpmath=38
7 -msse2 -msse -m3dnow -mmmx -fvisibility=hidden -g @CMakeFiles/SDL2.dir/includes_C.rsp -o CMakeFiles\SDL2.dir\src\re
nder\direct3d\SDL_render_d3d.c.obj -c …\src\render\direct3d\SDL_render_d3d.c
…\src\render\direct3d\SDL_render_d3d.c:1897:1: error: unknown type name 'IDirect3DDevice9’
IDirect3DDevice9 *
…\src\render\direct3d\SDL_render_d3d.c:1898:25: error: unknown type name 'SDL_Renderer’
SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
make.exe[2]: *** [CMakeFiles/SDL2.dir/src/render/direct3d/SDL_render_d3d.c.obj] Error 1
make.exe[2]: Leaving directory c:/projects/jxn/jxnn-lib/ext/src/sdl-r8133/~cmake-mingw-debug' make.exe[1]: *** [CMakeFiles/SDL2.dir/all] Error 2 make.exe[1]: Leaving directoryc:/projects/jxn/jxnn-lib/ext/src/sdl-r8133/~cmake-mingw-debug’
make.exe: *** [all] Error 2

// I just wanted to edit this SDL_render_d3d.c by myself…
// But I think I should wait for your fix, Ryan
// Thx

Can you email me the output from when you ran the configure script?

–ryan.On 01/28/2014 02:06 AM, JeriX wrote:

There is another error, on this time it is on compilation stage (

Has anyone found a fix for that? I’m facing the same problem. I disabled
every DirectX options since I don’t need DirectX and still doesn’t work!
(compiler gcc 4.8.1, os windows)

Error messages:
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1897:1: error: unknown
type name 'IDirect3DDevice9’
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1898:25: error: unknown
type name ‘SDL_Renderer’–
View this message in context:
Sent from the SDL mailing list archive at

We had some conversation by email with Ryan.
He said he’ll fix that but I still didn’t saw any related commits :frowning: