Wx Haskell On Mac OSX
Atze
Steps required to make a MacOSX application using WxHaskell, for GHC 7.0.3, dd 20110523
Prerequisites
wx
- Install wx, using brew. Make sure no previous wx installation hangs around, in particular not in /usr/local/include and /usr/local/lib as suggested by the brew installation.
$ brew install wxmac
wxHaskell
$ cabal install wx
$ cabal install cabal-macosx
Building a hello world app
- Get the wx hello world example from the cabal-macosx archive.
- In order to run on MacOSX the following additional tweaks have to be made:
- Follow these instructions to use enableGUI, which boils down to including/importing module EnableGUI in your project, and calling enableGUI before the actual program is started up.
- The thus imported module EnableGUI requires the use of FFI, so the cabal file for the example needs ghc to use FFI, accomplished by (e.g.) the following line in the cabal file:
ghc-options: -fwarn-tabs -threaded -Wall -ffi
--
AtzeDijkstra - 23 May 2011