安装gtk2hs失败

时间:2016-02-21 19:50:51

标签: haskell gtk cabal-install

我按照说明使用http://wiki.haskell.org/Gtk2Hs/Installationgtk上安装Windows 8.1 x64库。

我安装了MSYS2并用它来下载和构建gtk。然后我跑了:

cabal update // ok

cabal install gtk2hs-buildtools // ok

cabal install gtk // failed, 

cabal日志:

  • glib.log

    构建glib-0.13.2.2 ...
    预处理库glib-0.13.2.2 ...
    dist \ build \ System \ Glib \ StoreValue_hsc_utils.o:StoreValue_hsc_utils.c :(。text + 0x0):`__debugbreak'的多重定义

    dist \ build \ System \ Glib \ StoreValue_hsc_make.o:StoreValue_hsc_make.c :(。text + 0x0):首先在这里定义
    collect2.exe:错误:ld返回1退出状态
    链接dist \ build \ System \ Glib \ StoreValue_hsc_make.o失败(退出代码1)
    命令是:C:\ Program Files \ Haskell Platform \ 7.10.3 \ mingw \ bin \ gcc.exe dist \ build \ System \ Glib \ StoreValue_hsc_make.o dist \ build \ System \ Glib \ StoreValue_hsc_utils.o -o dist \ build \ System \ Glib \ StoreValue_hsc_make.exe -LC:/ msys64 / mingw64 / lib -lgobject-2.0 -lglib-2.0 -lintl -LC:\ Users \ Lexa27 \ AppData \ Roaming \ cabal \ x86_64-windows-ghc-7.10.3 \ utf8-string-1.0.1.1-L8eKHa7Iv9q7FVKUYW6u4b -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ extralibs \ text-1.2.1.3 -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ binar_3uXFWMoAGBg0xKP9MHKRwi -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ conta_2C3ZI8RgPO2LBMidXKTvIU -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ _字节_6VWy06pWzJq9evDvK2d4w6 -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ deeps_6vMKxt5sPFR0XsbRWvvq59 -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ array_67iodizgJQIIxYVTp4emlA -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ base_HQfYBxpPvuw8OunzQu6JGM -lwsock32 -luser32 -lshell32 -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ LIB \ integ_2aU3IZNMF9a7mQ0 OzsZ0dS -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib \ ghcpr_8TmvWUcS1U1IKHT0levwg3 -LC:\ Program Files \ Haskell Platform \ 7.10.3 \ lib / rts -lm -lwsock32 -lgdi32 -lwinmm

  • build.log https://drive.google.com/file/d/0B9t961_0P4GbMWhhMklSMDlpRkE/view?usp=sharing
  • gtk2hs-buildtools https://drive.google.com/file/d/0B9t961_0P4GbdXpGT081V0hHeFE/view?usp=sharing

1 个答案:

答案 0 :(得分:0)

我在过去两天遇到了同样的错误消息 终于得到了解决方法(虽然我使用的是win7 -x64)。

您需要从https://hackage.haskell.org/package/glib单独下载glib。然后你需要调整glib.cabal,如下所述: https://mail.haskell.org/pipermail/haskell-cafe/2015-October/121935.html (你必须删除cpp-option:' - D__attribute __(A)=')

最后,切换到你的glib目录并运行:

cabal install glib.cabal

这应该有效。您可能必须对其他gtk +依赖项执行相同的步骤。