2010-11-30 17 views
1

OSXでGTK +のHaskell API gtk2hsを使用しようとしています。私はHomebrew経由でghcとhaskell-platformをインストールしました。Haskell gtk2hs、適切な画像が見つかりませんでした。

は、それから私は、これらの3つのコマンドを実行しました:

cabal update 
cabal install gtk2hs-buildtools 
cabal install gtk 

私は実行するには、この小さなプログラムを作るしようとしている:

module GUI where 

import Graphics.UI.Gtk 

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

それがうまくコンパイルされます。私はメインの実行時にでも、私が手:グーグルながら

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) 

私はこの問題のいくつかの他の例を見ましたが、この場合ではどれも適しています。

答えて

2

あなたの自家製パッケージのアーキテクチャは何ですか? gettextのは、64ビットのかもしれように見えますが、GHCは現在、OS X上で32ビットをサポートしているあなたは、リポとアーキテクチャを確認することができます。

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

あなたが利用可能なアーキテクチャとしてリストI386が表示されない場合は、 gettext(とおそらく他の多くのlibs)を32ビットまたは汎用バイナリとして再コンパイルする必要があります。

+0

ああ... x86_64のみ。そんなことは嫌です。助けてくれてありがとう! – rejeep

+0

FWIW、ghcの次のリリースはOS X上で64ビットをサポートしている可能性が高いです。明らかに、現在のリリースではサポートされていますが、すぐに使用できるわけではありません。 –

関連する問題