2010-11-30 13 views
1

J'essaie d'utiliser GTK + API Haskell gtk2hs dans OSX. J'ai installé ghc et haskell-platform via Homebrew.Haskell gtk2hs, aucune image appropriée trouvée

Puis j'ai couru ces trois commandes:

cabal update 
cabal install gtk2hs-buildtools 
cabal install gtk 

Je suis en train de faire ce petit programme à exécuter:

module GUI where 

import Graphics.UI.Gtk 

main = do 
    initGUI 
    win <- windowNew 
    onDestroy win mainQuit 
    widgetShow win 
    mainGUI 

Il compile très bien. Mais quand je lance principale, je reçois:

Loading package array-0.3.0.1 ... linking ... done. 
Loading package bytestring-0.9.1.7 ... linking ... done. 
Loading package containers-0.3.0.0 ... linking ... done. 
Loading package filepath-1.1.0.4 ... linking ... done. 
Loading package old-locale-1.0.0.2 ... linking ... done. 
Loading package old-time-1.0.0.5 ... linking ... done. 
Loading package unix-2.4.0.2 ... linking ... done. 
Loading package directory-1.0.1.1 ... linking ... done. 
Loading package process-1.0.1.3 ... linking ... done. 
Loading package time-1.1.4 ... linking ... done. 
Loading package random-1.0.0.2 ... linking ... done. 
Loading package haskell98 ... linking ... done. 
Loading package transformers-0.2.2.0 ... linking ... done. 
Loading package mtl-2.0.1.0 ... linking ... done. 
Loading package cairo-0.12.0 ... linking ... done. 
Loading package glib-0.12.0 ... can't load .so/.DLL for: intl (dlopen(/usr/local/Cellar/gettext/0.17/lib/libintl.dylib, 9): no suitable image found. Did find: 
    /usr/local/Cellar/gettext/0.17/lib/libintl.dylib: mach-o, but wrong architecture) 

j'ai vu d'autres exemples de ce problème tout en googler, mais aucun approprié dans ce cas.

Répondre

2

Quelle est l'architecture de vos packs homebrew? On dirait que gettext peut être 64 bits, mais GHC prend actuellement en charge 32 bits sur Mac OS X. Vous pouvez vérifier les architectures avec lipo:

MacBook-1:~ john$ lipo -info /opt/local/lib/libintl.dylib 
Architectures in the fat file: /opt/local/lib/libintl.dylib are: i386 x86_64 

Si vous ne voyez pas i386 répertorié comme une architecture disponible, vous aurez besoin de recompiler gettext (et probablement beaucoup d'autres libs) en binaires 32 bits ou universels.

+0

Ahh ... Seulement x86_64. Ce genre de craint. Merci pour l'aide! – rejeep

+0

FWIW, il est probable que la prochaine version de Ghc supportera 64 bits sous OS X. Apparemment, elle est supportée par la version actuelle, mais pas prête à l'emploi, et je n'ai pas encore réussi à la faire fonctionner. –