Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell SDL: Can't find mingw32.dll

I finally made it to install Haskell SDL bindings on Windows. Using this:

> $env:Path += ";C:\SDL;C:\SDL\bin;C:\SDL\include;C:\SDL\lib"
> cabal install SDL --extra-include-dirs="C:\SDL\include" --extra-lib-dirs="C:\SDL\lib"

This works, as long as Cygwin is installed for the configure script. However, I wrote a tiny test script:

import Graphics.UI.SDL as SDL
import Control.Monad (void)
import Control.Exception (bracket_)

main = bracket_ (SDL.init [InitEverything]) quit $ do
  screen <- setVideoMode 800 600 0 []
  SDL.flip screen
  void $ waitEvent

Trying this now gives me this error message:

*Main> :main
Loading package SDL-0.6.4 ... <interactive>: mingw32: Cannot find specified module.
can't load .so/.DLL for: mingw32.dll (addDLL: could not load DLL)

Now I was looking for that mingw32.dll but I couldn't find it on my computer, though I have MinGW32 installed. Does anyone have had any experience here?

Using SDL-0.6.4, GHC 7.4.2 from Haskell Platform 2012.4.0.0. Windows 7 64-Bit.

ADDITION: I have now also tried it in the way A Haskell Adventure In Windows recommends, and that has the very same result.

like image 455
Lanbo Avatar asked Apr 14 '13 07:04

Lanbo


2 Answers

It may be a 64 vs. 32 bit issue. Try copying that .dll to:

  • 64-bit version of Windows: copy to c:\windows\syswow64
  • 32-bit version of Windows: copy to c:\windows\system32

That helped me with FTGL - see here

like image 150
sinelaw Avatar answered Oct 20 '22 13:10

sinelaw


I used MSYS/MinGW to build, and I was having the exact same problem. After fiddling around I found that the flag -lmingw32 (in the file sdl-config) is being used, and this seems to imply mingw32.dll. I simple remove this flagged, and everything worked.

like image 23
Pedro Rodrigues Avatar answered Oct 20 '22 13:10

Pedro Rodrigues