首页 > 解决方案 > Cabal 为 mac-os 失败安装 Wx

问题描述

我正在与 Haskell 库建立爱/恨关系。无论如何,我真的很想深入学习 Haskell,但图书馆大部分时间都在试图阻止我(或者鼓励我自己写,但我还没有完全做到)。想试试 Wx 的 UI。阴谋集团一开始很高兴,但以来自地狱的消息结束。至少我认为是。

Downloading the latest package list from hackage.haskell.org
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Resolving dependencies...
Downloading fgl-5.7.0.1...
Downloading old-locale-1.0.0.7...
Configuring old-locale-1.0.0.7...
Downloading stm-2.5.0.0...
Configuring fgl-5.7.0.1...
Configuring stm-2.5.0.0...
Building old-locale-1.0.0.7...
Building fgl-5.7.0.1...
Building stm-2.5.0.0...
Installed old-locale-1.0.0.7
Downloading old-time-1.1.0.3...
Configuring old-time-1.1.0.3...
Building old-time-1.1.0.3...
Installed stm-2.5.0.0
Installed old-time-1.1.0.3
Downloading wxcore-0.11.1.2...
Configuring wxcore-0.11.1.2...
Failed to install wxcore-0.11.1.2
Build log ( /Users/administrator/.cabal/logs/ghc-8.4.3/wxcore-0.11.1.2-7WkQ04B76zVGNKKljmrN1g.log ):
cabal: Entering directory '/var/folders/81/50s00bl11pv7fn8dw4n0w03m0000gn/T/cabal-tmp-1098/wxcore-0.11.1.2'
error: Unknown option "--sysconfdir=/Users/administrator/Library/Haskell/etc". Use "--help" to show valid options.

cabal: Leaving directory '/var/folders/81/50s00bl11pv7fn8dw4n0w03m0000gn/T/cabal-tmp-1098/wxcore-0.11.1.2'
Installed fgl-5.7.0.1
Updating documentation index
/Users/administrator/Library/Haskell/share/doc/x86_64-osx-ghc-8.4.3/index.html
cabal: Error: some packages failed to install:
wx-0.11.1.2-3RIijI82LEqAoB6cQuvIlr depends on wx-0.11.1.2 which failed to
install.
wxcore-0.11.1.2-7WkQ04B76zVGNKKljmrN1g failed during the configure step. The
exception was:
ExitFailure 2

有什么建议吗?请不要说“使用 Gtk”,因为那更糟。如果有人可以帮助我,那就太好了。尽管航站楼是一个安全的居住地,但我想最终突破它并发现世界。“你好世界!”

标签: haskellwxwidgetscabal

解决方案


由于我不知道的原因,您的安装选择了一个非常旧版本的 wxcore (0.11)。

你有更多关于 hackage 的现代版本,也在 github repo 上: https ://github.com/wxHaskell/wxHaskell/

github 的版本是最新的(0.93),在大多数情况下运行良好,但是您需要在 wxcore 中更改 darwin 的 cc 标志:

-      cc-options: "-stdlib=libstdc++"
+      cc-options: "-stdlib=libc++"

(我已向邮件列表发送了一封电子邮件以记录此更改,并要求更新有关 hackage 的版本。)

否则,我可以确认 wxHaskell 在新的 Mac 上可以正常编译并且可以正常工作。


推荐阅读