GHC under Wine

From HaskellWiki
Revision as of 11:52, 8 November 2008 by Jeffz (talk | contribs) (Known issues - add note about MSYS)

Jump to: navigation, search

GHC runs flawlessly under Wine. Here's a guide on how to get it working.


First, get the latest version of Wine from

Next, grab the latest windows version of GHC from

installing ghc is as simple as typing: wine ghc-6.8.2-i386-unknown-mingw32.exe

Once this is all done, you should be good to start using GHC.


Create a simple haskell program to compile. Hello World examples are good. Try compiling it:

$ WINEDEBUG=-all wine ghc --make hello.hs
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking ...
$ wine hello
Hello, world!

If it all works well then you should be able to compile your Haskell programs for windows with GHC on Wine.

If you encounter specific, reproducible issues that are present in the latest release of wine you should file a bug report with the Wine project (so long as one doesn't already exist for the issue)

Known problems

  • MSYS does not integrate with MinGW correctly - [See Wine bug 15949]
  • removeDirectoryRecursive did not work correctly prior to wine-1.1.4-538-g2e8dec4. This most notably broke cabal install. Use Wine 1.1.5 or newer.

Native DLLs

Wine isn't perfect (yet) but does offer a solution for using native dlls, as an alternative to builtin dlls if certain functions are not implemented or are buggy and not yet fixed. To configure this use winecfg where you can specify settings for the ordering of preferences for loading dlls, Builtin only, Native only, Builtin then Native and Native then Builtin.

winetricks can be useful for installing common native dlls or software


You can enable tracing of various components within Wine to aid in debugging issues with Wine by using [Wine Debug Channels].

External Links

[GHC at the Wine AppDB]