我试图从here(github)安装haskell-chart,我克隆它,安装堆栈,运行堆栈设置(它安装GHC成功),但后来我运行 make 失败并显示消息:
...
Chart-cairo-1.8: copy/register
Chart-diagrams-1.8: copy/register
Progress: 4/6
-- While building package gtk-0.14.2 using:
/tmp/stack4807/gtk-0.14.2/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
...
[ 22 of 209] Compiling Graphics.UI.Gtk.Embedding.Plug ( .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Graphics/UI/Gtk/Embedding/Plug.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Graphics/UI/Gtk/Embedding/Plug.o )
/tmp/stack4807/gtk-0.14.2/Graphics/UI/Gtk/Embedding/Plug.chs:120:6:
Couldn't match expected type ‘CUInt’
with actual type ‘Maybe DrawWindow’
In the first argument of ‘gtk_plug_new’, namely...
堆栈版本为1.1.2 x86_64 hpack-0.14.1,LTS Haskell 5.18(ghc-7.10.3)。我该怎么处理这个错误?
答案 0 :(得分:2)
为了从linux上的github源构建haskell-chart,应该在stack.yaml
中替换
flags:
gtk:
have-quartz-gtk: true
与
flags: {}
因为Linux不使用Quartz标志have-quartz-gtk
,而且不需要Quartz来构建gtk(Windows也不使用Quartz)。
答案 1 :(得分:0)
使用 brew 我将gtk +从版本2.24.25升级到2.24.30并安装了最新版本的XQuartz(版本2.7.9 - 我无法确定我最初安装的版本。)
通过这些更改,我能够使用stack build
成功构建项目。
特定命令:
$ brew cask install xquartz --force
$ brew upgrade gtk
答案 2 :(得分:0)