1 Overview

This page describes how to get a working wxHaskell installation on various platforms. The wxHaskell team have prepared a candidate for their latest official release (of March 2008) [please test it out].

The installation process has become increasingly stable and simple, but some of the information on this page could become outdated. Current development on wxHaskell takes place in the darcs repository at http://darcs.haskell.org/wxhaskell .

2 Getting wxWidgets

wxHaskell would not build cleanly for me with the most recent variants of wxWidgets. Under Windows, I was successful in compiling against wxWidgets 2.4.2. Mac OSX (Tiger) has a pre-installed version of wxWidgets 2.5, and it is possible to compile against this provided that a patch is applied - see the section on Mac OSX for details.

For PC running Windows: I recommend wxWidgets 2.4.2. Newer versions are alleged to build, but I (and others) have had problems. If you want to use ghci, you definitely want 2.4.2. Download from Sourceforge. Unless you particularly wish to build from source, the wxMSW-2.4.2-setup.zip download is fine (it provides a Windows installer for most of what you need. Documentation is a separate (and useful) download. You will make your life easier if you install to a path which does not contain spaces - my recollection is that this is not the default provided by the installer.

4.1.2 Assumptions (a.k.a. what I have tested)

wxWidgets built/installed in a path with no spaces in it. Actually you can use a path with spaces but there are a few rules. For example, I had ghc installed to this location:C:\Program Files\Visual HaskellSo this required me to use the following configure command:./configure --libdir=C:/Progra~1/Visual~1

The two important things here are: 1) You must use the forward slash
and 2) you cannot use spaces.

Next I found that I needed to add C:\Program Files\Visual Haskell to
my path so that the wxHaskell dlls could be located by windows.

Environment variables:

PATH should include MinGW and Cygwin binary directories. MinGW must come before Cygwin in PATH.

Build wxHaskell from the darcs repository, configured with ./configure --enable-split-objs -hcprof, and follow the usual installation documentation from here on. The --enable-split-objs and -hcprof options are not mandatory, but they are nice to have

Note 2008-02-20: there was a bug that made --with-opengl necessary on some systems (depending on how wxWidgets was built), but it has been fixed

4.3.2 Debian and Ubuntu

4.3.2.1 Ghc 6.6 version

For Debian Linux systems:

get wxWidgets 2.6

aptitude install libwxgtk2.6-dev

obtain the wxhaskell-bin-debian-gtk2.6.3-ghc6.6-0.10.3-rc1.deb package from sourceforge

Install it with dpkg -i

4.3.2.2 Ghc 6.8 version

get wxWidgets 2.6

aptitude install libwxgtk2.6-dev

get ghc

apt-get --target-release=unstable install ghc6

obtain the wxhaskell-bin-gtk2.6.3-ghc6.8.2-0.10.3-rc1.deb package from sourceforge

Note: Online resources say that this is the solution to build wxWidgets 2.6.* on Leopard. But we haven't tested this out yet. If you succeed in use wxHaskell on Leopard this way, please report wxhaskell-users mailing-list!

Configure Succeeded (and nothing more)

Solution: Upgrade to the latest version of Cabal and cabal-install (darcs)

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool: file: -lwx_macu_media-2.6 is not an object file (not allowed in a library)

Solution: try --enable-mediactrl in the wxWidgets configure

Too many levels of symbolic links (Linux)

UNKNOWN!

5.2 App-compilation issues

Could not find module `Graphics.UI.WX':

Solution Make sure you build and install the wx package too (wxhaskell comes in two parts, wxcore, which is what you get if you do ./configure; make; make install; and wx, which you can install by cd'ing into its directory and doing the standard Cabal stuff)

Certain buttons and widgets (particularly, those inside of "boxed" environments) are not active (still a problem, 2008-02-20)

Solution: upgrade to latest version (probably 0.10.3 as of 2008-03-30, or darcs repository until then). It was a wxHaskell bug that is now fixed.

I only see the first letter of every word

Solution build wxWidgets with --enable-unicode. (We now use wchar* to store strings; but if wxWidgets is compiled without unicode, it thinks it's using char* and that null bytes are string terminators)