[Gtkhs] gtk+hs and ghc-6.0

Ch. A. Herrmann herrmann@fmi.uni-passau.de
Fri, 27 Jun 2003 15:29:50 +0200


Hi,

I was trying to build c2hs and gtk+hs using ghc-6.0,
but in "GdkGC.chs" the return type of "(gcUnref addr)"
in function "mkGC" was wrong.

>   -- *  A function returning a GC will have called gdk_gc_ref on this object.
>   --    Convert this address with mkGC to a Haskell GC.
>   mkGC :: Addr -> IO GC
>   mkGC addr = liftM GC $ newForeignObj addr (gcUnref addr)

Replacing the lift by an "error" call makes the building
to finish without error messages. Unfortunately, when using
to so-compiled gtk+hs, linking my application program did
not succeed, e.g.:

> Linking ...
> /public/packages/programming/gtk+hs_fromCVS_for_ghc-6.0//lib/gtk+hs-0.15.3/ghc6/libgtkHS.a(GtkCList.o): In function `__stginit_GtkCList_':
> GtkCList.o(.text+0x90): undefined reference to `__stginit_Bits_'
> /public/packages/programming/gtk+hs_fromCVS_for_ghc-6.0//lib/gtk+hs-0.15.3/ghc6/libglibHS.a(GMarsh.o): In function `__stginit_GMarsh_':
> GMarsh.o(.text+0x46): undefined reference to `__stginit_Word_'
> GMarsh.o(.text+0x50): undefined reference to `__stginit_Int_'

Maybe, gtk+hs or c2hs are not yet working with ghc-6.0?
I took the gtk+hs from CVS.

Many thanks in advance
--
 Christoph