Personal tools

SDL/Windows

From HaskellWiki

< SDL(Difference between revisions)
Jump to: navigation, search
(Added error messages)
(Added remark about replacing buggy SDL_platform.h)
Line 8: Line 8:
 
* http://www.libsdl.org/projects/SDL_mixer
 
* http://www.libsdl.org/projects/SDL_mixer
  
Copy the bin, lib, include and share directories from the packages to a common directory,  
+
Copy the bin, lib, include and share directories from the packages to a common directory, like C:\Libraries. If you downloaded SDL 2.0.3, replace the header file include/SDL_platform.h with [https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h the debugged version]
like C:\Libraries. Set environment variables like this:
+
 
To help consistency in the environment variables, we first do:
+
Set environment variables like this:
 +
* To help consistency in the environment variables, we first do:
 
   Set LIBRARY_DIR=C:\Libraries
 
   Set LIBRARY_DIR=C:\Libraries
then:
+
* then:
 
   Set PATH=%LIBRARY_DIR%\bin;%PATH%
 
   Set PATH=%LIBRARY_DIR%\bin;%PATH%
 
   Set LIBRARY_PATH=%LIBRARY_DIR%\lib
 
   Set LIBRARY_PATH=%LIBRARY_DIR%\lib

Revision as of 21:33, 7 October 2014

How to install hsSDL2 on a Windows computer

Download and unpack the SDL2 development libraries from:

Copy the bin, lib, include and share directories from the packages to a common directory, like C:\Libraries. If you downloaded SDL 2.0.3, replace the header file include/SDL_platform.h with the debugged version

Set environment variables like this:

  • To help consistency in the environment variables, we first do:
 Set LIBRARY_DIR=C:\Libraries
  • then:
 Set PATH=%LIBRARY_DIR%\bin;%PATH%
 Set LIBRARY_PATH=%LIBRARY_DIR%\lib
 Set C_INCLUDE_PATH=%LIBRARY_DIR%\include\SDL2;%LIBRARY_DIR%\include

If you don't have git yet, install it. Go to a directory where you want the Haskell library source code installed and fetch the Haskell libraries:

 git clone https://github.com/Lemmih/hsSDL2
 git clone https://github.com/jdeseno/hs-sdl2-image
 git clone https://github.com/osa1/hsSDL2-ttf
 git clone https://github.com/jdeseno/hs-sdl2-mixer

If you want to use a cabal sandbox:

 cabal sandbox init

Install the Haskell packages:

 cabal install .\hsSDL2
 cabal install .\hs-sdl2-image
 cabal install .\hsSDL2-ttf
 cabal install .\hs-sdl2-mixer


If you get any of the messages:

 cabal: Missing dependency on a foreign library:
 * Missing (or bad) header file: SDL_mixer.h
 configure: error: *** SDL not found! Get SDL from www.libsdl.org.

you should check if all installation steps were done properly.