[Haskell-cafe] Using Gtk2Hs version 0.9.12 on a PPC Mac

Thorkil Naur naur at post11.tele.dk
Sat Jul 28 06:16:02 EDT 2007


Hello,

(From the archives:)
> [Haskell] ANNOUNCE: Gtk2Hs version 0.9.12 released
> Duncan Coutts duncan.coutts at worc.ox.ac.uk 
> Fri Jul 27 15:20:57 EDT 2007 

> Gtk2Hs - A GUI Library for Haskell based on Gtk+

> Version 0.9.12 is now available from:
> ...
> Duncan
> (on behalf of the Gtk2Hs team)

Following the advice of nominolo_ from #haskell yesterday, I added 
-L/opt/local/lib to my ghc command and then the helloworld demo of Gtk2Hs 
worked. The problem seems to be the order in which the two library 
directories /usr/X11R6/lib and /opt/local/lib appear on the link command: For 
the GTK+ example that worked, /opt/local/lib comes first. For the Gtk2Hs demo 
that failed, /usr/X11R6/lib comes first.

I compared these two directories and found these common files:

X11
libXft.2.dylib
libXft.a
libXft.dylib
libXrender.1.dylib
libXrender.a
libXrender.dylib
libexpat.0.dylib
libexpat.a
libexpat.dylib
libfontconfig.1.dylib
libfontconfig.a
libfontconfig.dylib
libfreetype.6.dylib
libfreetype.a
libfreetype.dylib
pkgconfig

Since some of these (Xrender, fontconfig, and freetype) are actually used in 
GTK+ (and therefore also Gtk2Hs) applications, there is clearly a potential 
for conflict here.

In any case, adding -L/opt/local/lib to the ghc command makes this library 
appear before /usr/X11R6/lib on the link command and this seems to solve the 
problem. Subsequently, I have tried a handful of the other demos, and as far 
as they didn't require something that wasn't available (glade, for example), 
they seemed to work.

Thanks and best regards
Thorkil


More information about the Haskell-Cafe mailing list