6

基本问题:

我正在尝试使用OSX 10.10.4 上的标准 mac 指令gtk安装 Haskell 的软件包。具体来说,我想运行,所以我需要. 早期阶段和工作都很好,但是当我threadscopegtkhomebrewgtk buildtools

cabal install gtk

或使用

cabal install --with-gcc=gcc-4.8 gtk

我收到以下编译错误:

Graphics/UI/Gtk/Embedding/Plug.chs:120:6:
Couldn't match expected type ‘Ptr ()’
            with actual type ‘Maybe DrawWindow’
In the first argument of ‘gtk_plug_new’, namely
  ‘(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
In the second argument of ‘($)’, namely
  ‘gtk_plug_new
     (fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’

Graphics/UI/Gtk/Embedding/Plug.chs:137:6:
Couldn't match expected type ‘Ptr ()’
            with actual type ‘Maybe DrawWindow’
In the second argument of ‘\ (Display arg1) arg2
                             -> withForeignPtr arg1
                                $ \ argPtr1 -> gtk_plug_new_for_display argPtr1 arg2’, namely
  ‘(fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’
In the second argument of ‘($)’, namely
  ‘(\ (Display arg1) arg2
      -> withForeignPtr arg1
         $ \ argPtr1 -> gtk_plug_new_for_display argPtr1 arg2)
     display
     (fromNativeWindowId (fromMaybe nativeWindowIdNone socketId))’

Graphics/UI/Gtk/Embedding/Plug.chs:151:3:
Couldn't match type ‘Ptr ()’ with ‘Maybe DrawWindow’
Expected type: IO (Maybe DrawWindow)
  Actual type: IO (Ptr ())
In the second argument of ‘($)’, namely
  ‘(\ (Plug arg1)
      -> withForeignPtr arg1 $ \ argPtr1 -> gtk_plug_get_id argPtr1)
     (toPlug self)’
In the expression:
  liftM toNativeWindowId
  $ (\ (Plug arg1)
       -> withForeignPtr arg1 $ \ argPtr1 -> gtk_plug_get_id argPtr1)
      (toPlug self)
cabal: Error: some packages failed to install:

在我将Haskellgtk平台threadscope从. 起初我假设安装冲突,但我反复使用彻底的删除说明从我的系统中删除了 Haskell 平台,并重新尝试安装,但没有成功。我什至使用 删除并重新安装了底层和相关软件包,但还是没有成功。ghc 7.8.4ghc 7.10.2threadscopegtk+homebrew

我不确定类型Ptr ()Maybe DrawWindow起源,因此不确定冲突可能来自哪里。欢迎任何关于可能出错的想法!

4

2 回答 2

3

也许您可以尝试使用此行安装 gtk

cabal install gtk -fhave-quartz-gtk

于 2016-02-02T14:09:04.753 回答
1

在 edsko 的博客上有一个安装 GTK 和 threadscope 的方法:

http://www.edsko.net/2015/03/09/sandboxes-revisited/

在页面中搜索“GTK 沙盒”。

更新

我能够使用 ghc-7.10.2 的上述说明构建线程范围。

我使用的具体命令:

export PATH=/opt/X11/lib/pkgconfig
brew install gtk+                      # installed gtk+-2.24.25
brew install poppler                   # installed poppler-0.35.0
cabal sandbox init
cabal install gtk2hs-buildtools
cabal install gtk
cabal install poppler --with-gcc=gcc-4.9 --extra-include-dirs=/usr/local/include
cabal install threadscope

沙箱中安装的包的具体版本:

cairo-0.13.1.0
ghc-events-0.4.4.0
gio-0.13.1.0
glib-0.13.2.1
gtk-0.13.9
hashtables-1.2.0.2
pango-0.13.1.0
poppler-0.13.1
utf8-string-1.0.1.1
于 2015-10-13T14:49:28.403 回答