SDL install
SDL is easy and safe to install.
In Linux
Install package libsdl1.2-dev.
In Windows
Safe way
Download SDL from U++ Sourceforge following the link. They include .dll, .lib, .a, .h and source code for recent versions.
Copy the downloaded folders in upp folder. You will get a folder structure like this:
drive:\upp\plugin_LGPL\SDL
In Setup/Build Methods menu include the next folders:
PATH - executable directories
|
INCLUDE directories
|
LIB directories
|
drive:\upp
|
drive:\upp\plugin_LGPL\SDL\include
|
drive:\upp\plugin_LGPL\SDL\lib
|
|
Medium/Hard
Download binaries/prebuilt packages from here.
http://www.libsdl.org/release/SDL-devel-1.2.14-VC8.zip
http://www.libsdl.org/release/SDL-devel-1.2.14-mingw32.tar.gz
unzip the stuff into 2 separate locations, e.g
C:\SDL-devel-1.2.14-VC8\SDL-1.2.14
C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14
the build methods need to access those respective folders
MSC build method, add to
PATH: C:\SDL-devel-1.2.14-VC8\SDL-1.2.14\lib
INCLUDE: C:\SDL-devel-1.2.14-VC8\SDL-1.2.14\include
LIB: C:\SDL-devel-1.2.14-VC8\SDL-1.2.14\lib
MINGW/TDMGCC build method, add to
PATH: C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14\lib
C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14\bin
INCLUDE: C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14\include
LIB: C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14\lib
C:\SDL-devel-1.2.14-mingw32\SDL-1.2.14\bin
the MSC libraries only come in shared linkage flavor, while the mingw flavor can be linked both shared and staticly.
the mingw SDL.dll.a is needed for static linkage and has got that weired name. who knows why. the SDL.dll comes in bin folder, thats why double folder specification is needed fir MINGW build method
the WinMain@16 compile problem for mingw (google for it) makes the change of lib link order obligatory, thats why mingw32 is specified explicitly last. this makes the
WINAPI WinMain(...) { return main(); }
hack obsolete and enables the native usage of SDL means to handle entry point.
SDL redefines your own main to be SDL_main (see SDL.h), and provides own main.
the signature is critical.it must be
int main(int argc, char* argv[]);
|