-
Notifications
You must be signed in to change notification settings - Fork 0
Installation instructions for template Haskell project
- Download and run the installer here: http://www.haskell.org/platform/windows.html
-
Download
mingw-get-setup.exefrom here: http://www.mingw.org/wiki/Getting_Started and run it -
You should only have to select the msys-base meta-package. (which will install several other packages) Then from the menu: "Installation" -> "Apply Changes" And then press the "Apply" button to download and install
-
Once the changes are applied, you can close the installer
-
Take a note of the install path, it's ususally
C:\MinGWunless you change it. We'll call this themingw-install-path. (even though we're only installing msys)
-
Download the SDL-1.2 Win32 mingw32 development libraries from here: http://libsdl.org/download-1.2.php (they're usually at the bottom):
-
Extract them to some directory. We'll call this the
SDL-install-path -
In the extracted directory there should be a file:
bin/sdl_configopen it in a text editor-
There should be a:
prefix=/usr/local/cross-tools/i686-w64-mingw32replace it with your SDL-install-path, but make sure you replace all the backslashes in the path with for slashes, and remove the colons. So if your SDL-install-path was:C:\Developer\SDL-1.2.15you'd put/c/Developer/SDL-1.2.15 -
If your
SDL-install-pathhas spaces in it, you lose two nerd points and should go move it to a path without spaces.
-
-
Add the directory containing sdl_config to your path
-
Add
SDL-install-path\lib to your path
-
Run:
mingw-install-path\msys\1.0\msys.bat- (Which will probably be:
C:\MinGW\msys\1.0\msys.bat) - This should open a shell window
- (Which will probably be:
-
In the shell window, type:
cabal update -
If this is a fresh Haskell platform install you'll probably be prompted to update cabal-install, DON'T.
-
Then type:
cabal install sdl —-extra-include-dirs=SDL-install-path/include —-extra-lib-dirs=SDL-install-path/lib- For example:
cabal install sdl —-extra-include-dirs=/c/Developer/SDL-1.2.15/include —-extra-lib-dirs=/c/Developer/SDL-1.2.15/lib
- For example:
-
Download SDL_image windows development libraries here: http://www.libsdl.org/projects/SDL_image/release-1.2.html. They'll be named something like:
SDL_image-devel-1.2.12-VC.zip -
Extract it to a directory
- we'll refer to this directory as
SDL_image-install-path
- we'll refer to this directory as
-
Take SDL_Image.h from
SDL_image-install-path/include and copy it toSDL-install-path/include/SDL -
Take everything in
SDL_image-install-path/lib/x86and copy it toSDL-install-path/lib- Note the
x86in the above path, don't copy the wrong one.
- Note the
-
Once we get everything working you can delete the
SDL_image-install-pathas we've copied everything we need out of it.
-
In a directory of your choice (but from the msys shell) do a
cabal unpack SDL-image- This will download and unpack the SDL-image package from hackage
-
Open
SDL-image-0.6.1\Graphics\UI\SDL\Image\Version.hscin an editor-
underneath #include “SDL_image.h” add:
#ifdef main
#undef main
#endif
-
-
From the msys shell
cdinto the unpacked SDL-image directory and run:cabal install --extra-include-dirs=SDL-install-path/include/SDL --extra-lib-dirs=SDL-install-path/lib- (note this is slightly different command from the SDL cabal install, though it looks similar)
Now if you want you can switch back to a normal windows cmd shell
-
In a directory of your choosing do a
git clone https://github.com/Manticore/haskell-sdl-template -
Then
cdinto that directory and do:cabal install --only-dependenciescabal configurecabal build
-
Copy image.png to
dist\build\Resources(You'll have to create theResourcesdir) -
Run
dist\build\sdltemplate\sdltemplate.exe
TADA!