<div dir="ltr"><p>Hello,<br></p><p>I&#39;m trying to build the latest SDL-image package (0.5.2) from Hackage on Windows and encountering problems. &nbsp;These are the steps I&#39;ve taken so far:</p><p>1. &nbsp;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 E:\SDL_image-1.2.6.<br>
2. &nbsp;Installed SDL package from Hackage, modifying the SDL.cabal according to the included WIN32 readme file and then runghc Setup.lhs configure/build/install<br>3. &nbsp;Downloaded the SDL-image package from Hackage, modified the SDL-image.cabal file to add the line &quot;Include-Dirs: E:\SDL_image-1.2.6\include\SDL, E:\SDL-1.2.13\include\SDL&quot; so Cabal can find the header files. &nbsp;After doing &quot;runghc Setup.lhs configure&quot;, &quot;runghc Setup.lhs build -v&quot; gives me the following output:<br>
</p><p>Creating dist\build (and its parents)<br>Creating dist\build\autogen (and its parents)<br>Preprocessing library SDL-image-0.5.2...<br>Creating dist\build\Graphics\UI\SDL\Image (and its parents)<br>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-3.0.1.0 --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 Graphics\UI\SDL\Image\Version.hsc<br>
E:/ghc/ghc-6.8.2/libHSrts.a(Main.o)(.text+0x7):Main.c: undefined reference to `__stginit_ZCMain&#39;<br>E:/ghc/ghc-6.8.2/libHSrts.a(Main.o)(.text+0x36):Main.c: undefined reference to `ZCMain_main_closure&#39;<br>collect2: ld returned 1 exit status<br>
linking dist\build\Graphics\UI\SDL\Image\Version_hsc_make.o failed<br>command was: E:\ghc\ghc-6.8.2\bin\ghc.exe dist\build\Graphics\UI\SDL\Image\Version_hsc_make.o -o dist\build\Graphics\UI\SDL\Image\Version_hsc_make.exe<br>
</p><p>The results of a limited google search suggests that the&nbsp;__stginit_ZCMain linker error has to do with GHC expecting a main function, but I&#39;m not really sure how that works in context of a library.</p></div>