5

I'm trying to install the SDL-image library for Haskell, a set of bindings for the original C library of the same name. I've already built and installed the SDL library and its corresponding Haskell package, and dropped the files from the SDL-image library into the directory where SDL was installed. Now when I try to install the SDL-image bindings I get the following error:

$ runghc Setup.lhs configure
Configuring SDL-image-0.6.1...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for sdl-config... /usr/bin/sdl-config
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... .o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for IMG_Load in -lSDL_image... no
configure: error: *** SDL_image lib not found! Get SDL_image from http://www.libdsl.org/projects/SDL_image/index.html

Some cursory googling told me I should be telling configure exactly where to find the lib file, but I'm not sure how to go about doing this. I've tried using the gcc flag -l[directory], but got the same result.

I'm using MinGW on Win7x64. Thanks in advance for any help, and apologies if I haven't included enough information, I'm not sure what's important because I don't understand the problem very well.

Einar
  • 151
  • 1
  • 4
  • How did you even build the SDL package? The version on Cabal is pretty buggy. –  Dec 05 '12 at 10:53
  • I'm not even sure, it must have been a fluke. :/ There was a set of instructions with the filename WIN32 in that package that walked me through the process. It involved modifying the Cabal file to include some extra directories. In fact, I wonder if that's the problem again this time? Hm – Einar Dec 05 '12 at 11:09
  • Those instructions are weird. Most of the steps are unnecessary, except for the hell of dynamic loading in GHCi. I'll try to get SDL_image working in a bit. Which version are you trying to use, btw? MinGW doesn't support 64-bit, at least not the one delivered with Haskell Platform, so make sure `libSDL_image.a` is the 32-bit one. –  Dec 05 '12 at 11:47
  • Helpfully the bindings and the OG libraries have different version names. SDL: 1.2.15, SDL_image: 1.2.12, HSDL: 0.6.4, HSDL_image: 0.6.1. I can't find `libSDL_image.a` though. I'm starting to wonder if I built SDL_image in the first place! – Einar Dec 05 '12 at 12:18

1 Answers1

1

I'm not sure about SDL_image, but I've successfully built SDL for Haskell. There's no need to go editing the cabal files.

Assuming you have the Haskell Platform, MINGW and MSYS installed, and the MINGW version of SDL somewhere, you just need to set the C_INCLUDE_PATH and LIBRARY_PATH environment variables to point to the headers and libs of SDL.

Once you've done that, you can use a MINGW shell to run cabal install SDL.

stusmith
  • 14,003
  • 7
  • 56
  • 89
  • Where are `INCLUDE_PATH` and `LIBRARY_PATH` located? – CoR Jan 15 '13 at 20:23
  • 1
    You can set them in Control Panel\System and Security\System -> Advanced System Settings -> Environment Variables (or just type "environment" into the start menu). – stusmith Jan 15 '13 at 21:04
  • 1
    My values are: `LIBRARY_PATH: C:\Local\SDL-1.2.15\lib`, and `C_INCLUDE_PATH: C:\Local\SDL-1.2.15\include` – stusmith Jan 15 '13 at 21:05
  • Thank you! This helped me a lot to set mingw properly. SDL-image is installed :) – CoR Jan 22 '13 at 23:38