From: Jens P. <pet...@re...> - 2003-06-16 07:59:21
|
Hi, Did anyone ever manage to get gtk2hs working with ghci-5.04.3? When I try to load it I get: % ghci-5.04.3 -package gtk2 : : Loading package data ... linking ... done. Loading package gtk2 ... GHCi runtime linker: fatal error: I found a duplicate definition for symbol __stginit_Arrow whilst processing object file /usr/lib/ghc-5.04.3/gtk2hs/gtk2hs.o This could be caused by: : : I'm pretty sure this is a known problem - not sure if it has ever worked with gtk2hs? I see that __stginit_Arrow is also defined in HSdata.o, but I'm not sure what the cause of the problem is? I tried a little to get gtk2hs to build with ghc-6.0, but only got to: abstract/Object.hs:121: Unacceptable argument type in foreign declaration: GObject When checking declaration: foreign import ccall unsafe "static &g_object_set_property" g_object_set_property :: (GObject) -> ((Ptr CChar) -> ((GValue) -> (IO ()))) seems the FFI in 6.0 doesn't like GObject... Jens |
From: Axel S. <A....@ke...> - 2003-06-16 08:44:58
|
On Mon, Jun 16, 2003 at 04:59:07PM +0900, Jens Petersen wrote: > Hi, > > Did anyone ever manage to get gtk2hs working with ghci-5.04.3? > When I try to load it I get: > > % ghci-5.04.3 -package gtk2 > : > : > Loading package data ... linking ... done. > Loading package gtk2 ... > > GHCi runtime linker: fatal error: I found a duplicate definition for > symbol > __stginit_Arrow > whilst processing object file > /usr/lib/ghc-5.04.3/gtk2hs/gtk2hs.o > This could be caused by: There was a bug in ghc-5.02 which was why I stopped pursuing the interactive issue. > I'm pretty sure this is a known problem - not sure if it has ever worked > with gtk2hs? I see that __stginit_Arrow is also defined in HSdata.o, > but I'm not sure what the cause of the problem is? I didn't find init_Arrow in HSdata.o. I get Loading package data ... linking ... done. Loading package gtk2 ... ghc-5.04: can't load .so/.DLL for: gtk2hs (Shared object "libgtk2hs.so" not found) Did you overcome this? > I tried a little to get gtk2hs to build with ghc-6.0, but only got to: > > abstract/Object.hs:121: > Unacceptable argument type in foreign declaration: GObject > When checking declaration: > foreign import ccall unsafe "static &g_object_set_property" g_object_set_property :: (GObject) > -> ((Ptr CChar) > -> ((GValue) > -> (IO ()))) > > seems the FFI in 6.0 doesn't like GObject... No, it will fail for the hand crafted import statements (and for all c2hs created ones). I have to look into the new c2hs release. If it fixed the bugs in the C preprocessor then I could incorporate it into the gtk2hs source tree. Gimme a week :-) Axel. |
From: Jens P. <pet...@re...> - 2003-06-16 13:22:24
|
2003年06月16日(月)の17時43分に Axel Simon 曰く: > On Mon, Jun 16, 2003 at 04:59:07PM +0900, Jens Petersen wrote: > > Did anyone ever manage to get gtk2hs working with ghci-5.04.3? > > When I try to load it I get: > > GHCi runtime linker: fatal error: I found a duplicate definition for > > symbol > > __stginit_Arrow > > whilst processing object file > > /usr/lib/ghc-5.04.3/gtk2hs/gtk2hs.o > There was a bug in ghc-5.02 which was why I stopped pursuing the > interactive issue. Ok. > > I'm pretty sure this is a known problem - not sure if it has ever worked > > with gtk2hs? I see that __stginit_Arrow is also defined in HSdata.o, > > but I'm not sure what the cause of the problem is? > > I didn't find init_Arrow in HSdata.o. I get > Loading package data ... linking ... done. > Loading package gtk2 ... ghc-5.04: can't load .so/.DLL for: gtk2hs (Shared > object "libgtk2hs.so" not found) > > Did you overcome this? Well, I installed the ghc package with the -g option to ghc-pkg. > > I tried a little to get gtk2hs to build with ghc-6.0, but only got to: > > > > abstract/Object.hs:121: > > Unacceptable argument type in foreign declaration: GObject > > When checking declaration: > > foreign import ccall unsafe "static &g_object_set_property" g_object_set_property :: (GObject) > > -> ((Ptr CChar) > > -> ((GValue) > > -> (IO ()))) > > > > seems the FFI in 6.0 doesn't like GObject... Btw to get this far I had to add lots of import Foreign hiding (newForeignPtr) import Foreign.Concurrent (newForeignPtr) all over the place, since newForeignPtr seems to have changed in 6.0. > No, it will fail for the hand crafted import statements (and for all c2hs > created ones). I have to look into the new c2hs release. If it fixed the > bugs in the C preprocessor then I could incorporate it into the gtk2hs > source tree. > > Gimme a week :-) Ok, thanks. I'll try with the new c2hs too. Jens |
From: Jens P. <pet...@re...> - 2003-06-17 01:07:22
|
2003年06月16日(月)の22時22分に Jens Petersen 曰く: > I'll try with the new c2hs too. Ok, I tried with c2hs-0.11.5, and got stuck in the same way: abstract/Object.chs:1: Unacceptable argument type in foreign declaration: GObject When checking declaration: foreign import ccall unsafe "static &g_object_get_property" g_object_get_property :: (GObject) -> ((Ptr CChar) -> ((GValue) -> (IO ()))) Jens |
From: Duncan C. <du...@co...> - 2003-06-16 20:32:19
|
On 16 Jun 2003 16:59:07 +0900 Jens Petersen <pet...@re...> wrote: > Did anyone ever manage to get gtk2hs working with ghci-5.04.3? > When I try to load it I get: > > % ghci-5.04.3 -package gtk2 > : > Loading package data ... linking ... done. > Loading package gtk2 ... > > GHCi runtime linker: fatal error: I found a duplicate definition for > symbol > __stginit_Arrow > whilst processing object file > /usr/lib/ghc-5.04.3/gtk2hs/gtk2hs.o My brief investigation into this revealed that __stginit_Arrow is defined in HSlang.o (ghci's object file for package lang) and this is the only standard package in which it is defined. __stginit_Arrow is indeed also defined in gtk2hs.o It is defined there because it is defined in gtk/misc/Arrow.o (in the buid tree). Itis defined there because Arrow is the name of the module and that symbol refers to the module initialisation function (or something like that, perhaps it's a module dependancy marker symbol). What seems to be happening is that the Arrow module in gtk2hs is clashing with the Arrow module in the lang package. As far as I can tell this all looks perfectly normal, so why don't we this kind of problem all the time? What's special about Arrow? How does it get resolved in the libHS*.a case? How does the system linker resolve the ambiguity when ghci's linker cannot? Duncan |