【发布时间】:2011-09-22 11:52:09
【问题描述】:
我需要 glib 才能使 threadscope 工作。但我无法使用 cabal 安装它。我尝试了cabal install glib,但出现以下错误。我什至尝试下载库并在本地安装它,但得到了同样的错误。
我在 Windows 上使用 Cygwin。我运行了 Cygwin 设置以确保我有丢失的库。我能找到 glib、gobject 但找不到 gthread。
Gtk2HsSetup.hs:25:2:
warning: #warning Setup.hs is guessing the version of Cabal. If compilation
of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when buil
ding (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist\setup\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( Setup.hs, dist\setup\Main.o )
Linking .\dist\setup\setup.exe ...
Configuring glib-0.12.0...
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: gobject-2.0, gthread-2.0, glib-2.0, intl, iconv
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Error: some packages failed to install:
glib-0.12.0 failed during the configure step. The exception was:
ExitFailure 1
【问题讨论】:
-
GLib 不是 Gtk2HS 的一个组件吗?如果是这样,您想按照在 Windows 上安装 Gtk2HS 的说明进行操作 - haskell.org/haskellwiki/Gtk2Hs。可能可以通过 Cygwin 绑定它,但如果你尝试的话,你会非常依赖自己。对于 Windows 上的 FFI 绑定,MinGW / MSYS 是 Unix 兼容性的常用解决方案。