【发布时间】:2013-10-24 15:45:45
【问题描述】:
我正在开始一个有望使用 gtk2hs 的新项目。但是,我无法让这个包安装在我相当典型的 Linux 机器上。这是失败:
[1 of 2] Compiling SetupWrapper ( /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs, /tmp/cairo-0.12.4-4201/cairo-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )
/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:94:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32
/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:95:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32
Failed to install cairo-0.12.4
[1 of 2] Compiling SetupWrapper ( /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs, /tmp/glib-0.12.4-4201/glib-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )
/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:94:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32
/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:95:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32
Failed to install glib-0.12.4
这似乎与最近的 cabal 版本有关,因为以前可以使用。这似乎是一个已知的错误(http://trac.haskell.org/gtk2hs/ticket/1292、http://trac.haskell.org/gtk2hs/ticket/1291 和http://trac.haskell.org/gtk2hs/ticket/1289),但它已经好几个星期没有移动了。我没有足够的能力提出一个好的解决方案,所以我想听听你的建议。这很烦人,因为我被困在这个重要的项目上,想到我们语言的主要 GUI 库已经坏了好几个星期了,我感到很痛苦。
使用 Cabal 库 / ghc 7.4.1 的 1.18.1.1 版安装 1.18.0.2 版
感谢您的帮助
【问题讨论】:
-
您可以编辑
Setup.hs并将其更改为使用显式导入。 -
您可以从您的错误消息中看到问题出在
cairo包中,在文件SetupWrapper.hs中,该文件定义了函数moreRecentFile,但还从Distribution.Simple.Utils(阴谋集团图书馆的一部分)。大概这是自cairo包经过测试以来添加到 cabal 的一个新功能。 Here 是我通过快速谷歌搜索找到的补丁;不知道状态。 -
谢谢。事实上,问题的根源很容易解决。我从未使用过 setup.hs 文件,我想这让我很困惑。我可能会走这条路,也许会尝试在上游修复。