【发布时间】:2014-03-16 23:38:29
【问题描述】:
我是 Haskell 的新手,想尝试一下 snap 框架。不幸的是,我无法编译。我已经尝试过(我也知道),更新 cabal 并运行 sudo ghc-pkg recache,但是当我运行 cabal install snap 时仍然得到以下信息。请帮忙。
12 warnings and 1 error generated.
Failed to install binary-0.7.1.0
cabal: Error: some packages failed to install:
SHA-1.6.4 depends on binary-0.7.1.0 which faile
d to install.
binary-0.7.1.0 failed during the building phase
. The exception was:
ExitFailure 1
pwstore-fast-2.4.1 depends on binary-0.7.1.0 wh
ich failed to install.
snap-0.13.2.2 depends on binary-0.7.1.0 which f
ailed to install.
解决方案:
我首先通过自制软件安装“真正的”gcc,如下所示:
brew update
brew install gcc47
这需要 一段时间 才能安装(例如一个多小时)。完成后,我更新了 GHC 设置以使用自制软件安装的 gcc 副本。
GHC 设置位于此处:
/Library/Frameworks/GHC.framework/Versions/Current/usr/lib/ghc-7.6.3/settings
或者如果你用自制软件安装了 ghc(我没有)。
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/settings
更新线路
("C compiler command", "/usr/bin/gcc")
到
("C compiler command", "/usr/local/Cellar/gcc47/4.7.3/bin/gcc-4.7")
然后运行
cabal update && cabal install snap
一切都会好起来的。 :)
【问题讨论】:
-
你能把你的所有你的输出(即上面的警告和错误)?最好在lpaste.net 或其他东西上。谢谢!
-
我正确的 gcc 可执行文件(使用 macports 安装 gcc49 后)是:(“C 编译器命令”,“/opt/local/bin/x86_64-apple-darwin13-gcc-4.9.0”)
标签: haskell cabal haskell-snap-framework