3 Notes

These notes tend to be a bit ephemeral and are thus dated to help you figure out if they may still apply or not.

2012-04-24 MacPorts: If you use MacPorts, you may run into a problem with the iconv library. Tell GHC that you prefer the system libraries first: ghc HelloWorld.hs -L/usr/lib

2012-04-17: The MacPorts version of wxWidgets 2.9.3 can be used. I added a few flags to the Portfile, but they are probably not necessary.

2012-04-14: On MacOS X Lion, to install wxWidgets 2.9 with HomeBrew, you may need to run brew install wxmac --use-llvm --devel

4 Using wxHaskell on MacOS X platforms

Even though graphical applications on MacOS X look great, it is a still a developers nightmare to get them working :-). This page describes how to circumvent some of the pitfalls.

Executables generated with GHC do not work when executed directly if they use the graphical API; they need to be upgraded into so called application bundles for MacOS X. Use the cabal-macosx package to automate this. It can be integrated with Cabal and/or used as a standalone macosx-app script.

Note: The following no longer applies to wxcore >= 0.90.0.1.

Due to complicated MacOS X restrictions, graphical wxHaskell applications do not work directly when used from GHCi. Fortunately, Wolfgang Thaller has kindly provided an ingenious Haskell module that solves this problem. Just import the (compiled) module EnableGUI in your program and issue the following command to run main from your GHCi prompt:

5 Troubleshooting

The dynamic link libraries used by wxHaskell can not always be found. If your application seems to start (the icon bounces) but terminates mysteriously, you need to set the dynamic link library search path to the wxHaskell library directory. For example: