SDL on Migw62 Windows 7

Im looking for a build of the current source code for mingw64, Is there any specific steps i have to take to build SDL2 on windows for Mingw64, or do i need to do it on linux with a cross compiling tool?, i cant find a good tutorial in how to do it.
any advice would be much appreciated.

I tried to use cmake to make the project files, and it works, but fails on compilation for directx issues related to mingw and not been a VS build im guessing, how you guys do the compiling of SDL in windows for Mingw ?

Use CMAKE GUI and turn off DirectX if you’re not going to use it. Then just make as usual

Turns out I needed to specify the mingw64 compiler tools on the cmake
generating process, instead of using codeblocks mingw native compilers that
are really outdated and lack a lot of stuff.

thanks.

2014-06-04 4:46 GMT-06:00 AlexRou :> Use CMAKE GUI and turn off DirectX if you’re not going to use it. Then

just make as usual


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Javier Flores

so im kind of confused, when the SDL2 project is compiled a libSDL2.dll
file is generated, these files are generated when compiling the SDL2 and
SDL2main projects:

libSDL2.a
libSDL2.dll.a
libSDL2main.a
libSDL2.dll

but my app wants to use SDL2.dll when running, is there anything extra i
have to do to get that file?, well, gonna keep reading about linking, there
is something im missing that i cant see right now.

2014-06-04 15:31 GMT-06:00 Javier Flores <@Javier_Flores>:> Turns out I needed to specify the mingw64 compiler tools on the cmake

generating process, instead of using codeblocks mingw native compilers that
are really outdated and lack a lot of stuff.

thanks.

2014-06-04 4:46 GMT-06:00 AlexRou :

Use CMAKE GUI and turn off DirectX if you’re not going to use it. Then
just make as usual


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Javier Flores


Javier Flores

I set CMAKE_SHARED_LIBRARY_PREFIX and CMAKE_SHARED_MODULE_PREFIX to empty
strings to remove the lib prefix.

Jonny DOn Wed, Jun 4, 2014 at 6:37 PM, Javier Flores wrote:

so im kind of confused, when the SDL2 project is compiled a libSDL2.dll
file is generated, these files are generated when compiling the SDL2 and
SDL2main projects:

libSDL2.a
libSDL2.dll.a
libSDL2main.a
libSDL2.dll

but my app wants to use SDL2.dll when running, is there anything extra i
have to do to get that file?, well, gonna keep reading about linking, there
is something im missing that i cant see right now.

2014-06-04 15:31 GMT-06:00 Javier Flores :

Turns out I needed to specify the mingw64 compiler tools on the cmake

generating process, instead of using codeblocks mingw native compilers that
are really outdated and lack a lot of stuff.

thanks.

2014-06-04 4:46 GMT-06:00 AlexRou :

Use CMAKE GUI and turn off DirectX if you’re not going to use it. Then
just make as usual


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Javier Flores


Javier Flores


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Is there any steps you do to get sdl2 compiling on Windows for mingw?, like
what kind of toolchain or something, im using cmake gui to make codeblocks
project files, but its just a mess and confusing. Also i dont know where to
set those strings to empty, i tried the makefiles, no results.–
Javier Flores

javierecf wrote:

Is there any steps you do to get sdl2 compiling on Windows for mingw?, like what kind of toolchain or something, im using cmake gui to make codeblocks project files, but its just a mess and confusing. Also i dont know where to set those strings to empty, i tried the makefiles, no results.

Javier Flores

Use CMAKE GUI and its less confusing. Also since you made a codeblocks project, you can just edit the name from within the project itself from the project properties. Also compiling a program using your compiled SDL2 will make your application look for libSDL2.dll instead, the only problem is for extensions like SDL_Image and so on.

If you really want to do it automatically edit CMakeList.txt and go to line 1243 and change it to look like the following:

if(SDL_SHARED)
add_library(SDL2 SHARED ${SOURCE_FILES})
if(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
else(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${SDL_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
endif()
set(_INSTALL_LIBS “SDL2” ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
endif()

after doing that, it works, the sdl2.dll file is created but it goes about
4.10mb really heavy in comparison to the ones from SDL2 dist dev pkgs, also
it works on my program but it generates a lot of bugs, like double calls of
SDL methods.

It would be really nice to have a site where there will be some automatic
daily builds for mingw and VS for devs. That would be amazing.

2014-06-04 18:04 GMT-06:00 AlexRou :>

javierecf wrote:

Is there any steps you do to get sdl2 compiling on Windows for mingw?,
like what kind of toolchain or something, im using cmake gui to make
codeblocks project files, but its just a mess and confusing. Also i dont
know where to set those strings to empty, i tried the makefiles, no
results.

Javier Flores

Use CMAKE GUI and its less confusing. Also since you made a codeblocks
project, you can just edit the name from within the project itself from the
project properties. Also compiling a program using your compiled SDL2 will
make your application look for libSDL2.dll instead, the only problem is for
extensions like SDL_Image and so on.

If you really want to do it automatically edit CMakeList.txt and go to
line 1243 and change it to look like the following:

if(SDL_SHARED)
add_library(SDL2 SHARED ${SOURCE_FILES})
if(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
else(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${SDL_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
endif()
set(_INSTALL_LIBS “SDL2” ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
endif()


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Javier Flores

Well why are you not using the stable sources/binaries? It seems like you’re pretty new to cmake/building sources in general.

javierecf wrote:> after doing that, it works, the sdl2.dll file is created but it goes about 4.10mb really heavy in comparison to the ones from SDL2 dist dev pkgs, also it works on my program but it generates a lot of bugs, like double calls of SDL methods.

It would be really nice to have a site where there will be some automatic daily builds for mingw and VS for devs. That would be amazing.

2014-06-04 18:04 GMT-06:00 AlexRou <@AlexRou (@AlexRou)>:

javierecf wrote:

Is there any steps you do to get sdl2 compiling on Windows for mingw?, like what kind of toolchain or something, im using cmake gui to make codeblocks project files, but its just a mess and confusing. Also i dont know where to set those strings to empty, i tried the makefiles, no results. 


Javier Flores

Use CMAKE GUI and its less confusing. Also since you made a codeblocks project, you can just edit the name from within the project itself from the project properties. Also compiling a program using your compiled SDL2 will make your application look for libSDL2.dll instead, the only problem is for extensions like SDL_Image and so on.

If you really want to do it automatically edit CMakeList.txt and go to line 1243 and change it to look like the following:

if(SDL_SHARED)
add_library(SDL2 SHARED ${SOURCE_FILES})
if(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
else(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${SDL_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
endif()
set(_INSTALL_LIBS “SDL2” ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
endif()


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


Javier Flores

yeah, i went back to the stable release for mingw to avoid this, i just
wanted some bug fixes that i can use from the current source, that im using
with the VS version of my app, cause building the current SDL in VS is so
much easier.

2014-06-05 0:05 GMT-06:00 AlexRou :> Well why are you not using the stable sources/binaries? It seems like

you’re pretty new to cmake/building sources in general.

javierecf wrote:

after doing that, it works, the sdl2.dll file is created but it goes
about 4.10mb really heavy in comparison to the ones from SDL2 dist dev
pkgs, also it works on my program but it generates a lot of bugs, like
double calls of SDL methods.

It would be really nice to have a site where there will be some automatic
daily builds for mingw and VS for devs. That would be amazing.

2014-06-04 18:04 GMT-06:00 AlexRou <>:

Quote:

javierecf wrote:

Is there any steps you do to get sdl2 compiling on Windows for mingw?,
like what kind of toolchain or something, im using cmake gui to make
codeblocks project files, but its just a mess and confusing. Also i dont
know where to set those strings to empty, i tried the makefiles, no
results.

Javier Flores

Use CMAKE GUI and its less confusing. Also since you made a codeblocks
project, you can just edit the name from within the project itself from the
project properties. Also compiling a program using your compiled SDL2 will
make your application look for libSDL2.dll instead, the only problem is for
extensions like SDL_Image and so on.

If you really want to do it automatically edit CMakeList.txt and go to
line 1243 and change it to look like the following:

if(SDL_SHARED)
add_library(SDL2 SHARED ${SOURCE_FILES})
if(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
else(UNIX)
set_target_properties(SDL2 PROPERTIES
VERSION ${SDL_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME “SDL2” PREFIX “” IMPORT_SUFFIX “.a”)
endif()
set(_INSTALL_LIBS “SDL2” ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
endif()


SDL mailing list

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


Javier Flores


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Javier Flores