Thursday, March 10, 2011

Haskell GTK on Windows

(see part 2 in a future post)

There seems to be some issues with the documentation as it relates to install GTK and Haskell (at least at present). There are two steps that need to be highlighted if they aren't already.

Task-Remove Install Paths with Spaces:

GTK has an windows installer like most windows apps and normally you would install the application/library to C:/Program[SPACE]Files/GTK[PLUS-SIGN]. Don't do that. The default install of GTK haskell win32 did not seem to work. I recommend the simple:

Install to: C:/gtk

Task-Setup mingw/bin in your PATH env:

Also, you may need to use the mingw install that comes with the haskell platform. Navigate to Haskell Platform/mingw/bin and copy that path and add it to your PATH environment variable setting.

Before doing this, you may see errors, cpp.exe is not found or other such compile errors. Adding mingw adds some of those compiler tools.

Optional

The glade/gtk bundle install to C:/gtk may not have all the dev libraries that you need. Install the bundle first and then visit the gtk site and download the gtk dev packages. Unzip and overwrite to the C:/gtk directory.

Run 'cabal install gtk' again...

More information:

C:\Documents and Settings\Usr Berlin]echo %PATH%
C:\Program Files\Gtk+\bin;C:\Program Files\Haskell\bin;C:\Program Files\Haskell
Platform\2010.2.0.0\lib\extralibs\bin;C:\Program Files\Haskell Platform\2010.2.0
.0\bin; ... and other stuff

C:\Documents and Settings\Usr Berlin>echo %PKG_CONFIG_PATH%
C:\Program Files\Gtk+\lib\pkgconfig;C:\Program Files\Gtk+\include\libglade-2.0;C
:\Program Files\libxml2\libxml2-dev_2.7.7-1_win32\lib\pkgconfig


C:\Documents and Settings\Usr Berlin>echo %INCLUDE%
C:\Program Files\Gtk+\include;C:\Program Files\libxml2\libxml2-dev_2.7.7-1_win32
\include;C:\Program Files\Gtk+\include\libglade-2.0;C:\Program Files\Gtk+\includ
e

C:\Documents and Settings\Usr Berlin]pkg-config.exe --modversion gtk+-2.0
2.16.2

C:\Documents and Settings\Usr Berlin]pkg-config --cflags gtk+-2.0
Files/Gtk+/include/gtk-2.0 -mms-bitfields Files/Gtk+/lib/gtk-2.0/include Files/G
tk+/include/atk-1.0 Files/Gtk+/include/cairo Files/Gtk+/include/pango-1.0 Files/
Gtk+/include/glib-2.0 Files/Gtk+/lib/glib-2.0/include Files/Gtk+/include/libpng1
2 -IC:/Program

C:\Documents and Settings\Usr Berlin]cabal update
Downloading the latest package list from hackage.haskell.org

C:\Documents and Settings\Usr Berlin]cabal install gtk

No comments:

Post a Comment