使用GHC的macports库构建问题

时间:2012-01-11 21:56:54

标签: haskell osx-snow-leopard macports ghc

我正在尝试关注haskell的图表库tutorial

我用macports安装了Cairo和gtk2hs。

但是当我尝试运行教程示例时,我收到以下错误:

$ ghc --make diagramsTutorial.lhs
Linking diagramsTutorial ...
ld: warning: in /opt/local/lib/libgtk-x11-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libgdk-x11-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libatk-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libpangocairo-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
.. etc...

我正在使用OS X 10.6.8,核心i5 macbook pro。

编辑我刚刚发现我正在使用32位haskell平台,这可能是问题的一部分。但是我无法安装64位版本(在安装过程中它有一个未指定的错误)。我找不到卸载程序。根据{{​​3}},我应该在/Library/Frameworks/GHC.framework/Tools/Uninstaller找到一个卸载程序,但那里什么也没有。

1 个答案:

答案 0 :(得分:2)

看起来Macports库只有64位。您可以查看lipo -info /opt/local/lib/libgtk-x11-2.0.dylib如果是这种情况,您应该使用+通用变体重新安装它们,这将允许链接32位和64位代码。