[Haskell-cafe] Building SDL-image package on Windows

Garrick Chin nonexistent.ftp+haskellcafe at gmail.com
Tue Aug 26 23:32:37 EDT 2008


I'm trying to build the latest SDL-image package (0.5.2) from Hackage on
Windows and encountering problems.  These are the steps I've taken so far:

1.  Downloaded SDL 1.2.13 developmental library for Mingw32 to
E:\SDL-1.2.13, and SDL_image 1.2.6 developmental library for VC8 to
2.  Installed SDL package from Hackage, modifying the SDL.cabal according to
the included WIN32 readme file and then runghc Setup.lhs
3.  Downloaded the SDL-image package from Hackage, modified the
SDL-image.cabal file to add the line "Include-Dirs:
E:\SDL_image-1.2.6\include\SDL, E:\SDL-1.2.13\include\SDL" so Cabal can find
the header files.  After doing "runghc Setup.lhs configure", "runghc
Setup.lhs build -v" gives me the following output:

Creating dist\build (and its parents)
Creating dist\build\autogen (and its parents)
Preprocessing library SDL-image-0.5.2...
Creating dist\build\Graphics\UI\SDL\Image (and its parents)
E:\ghc\ghc-6.8.2\bin\hsc2hs.exe --cc=E:\ghc\ghc-6.8.2\bin\ghc.exe
--ld=E:\ghc\ghc-6.8.2\bin\ghc.exe --cflag=-package --cflag=SDL-0.5.4
--cflag=-package --cflag=base-
--cflag=-IE:\SDL_image-1.2.6\include\SDL --cflag=-IE:\SDL-1.2.13\include\SDL
-o dist\build\Graphics\UI\SDL\Image\Version.hs
E:/ghc/ghc-6.8.2/libHSrts.a(Main.o)(.text+0x7):Main.c: undefined reference
to `__stginit_ZCMain'
E:/ghc/ghc-6.8.2/libHSrts.a(Main.o)(.text+0x36):Main.c: undefined reference
to `ZCMain_main_closure'
collect2: ld returned 1 exit status
linking dist\build\Graphics\UI\SDL\Image\Version_hsc_make.o failed
command was: E:\ghc\ghc-6.8.2\bin\ghc.exe
dist\build\Graphics\UI\SDL\Image\Version_hsc_make.o -o

The results of a limited google search suggests that the __stginit_ZCMain
linker error has to do with GHC expecting a main function, but I'm not
really sure how that works in context of a library.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080826/dc43ecf3/attachment.htm

More information about the Haskell-Cafe mailing list