haskell - 无法在 Windows 上安装 cairo haskell 绑定(bind)

标签 haskell cabal cairo

我正在尝试在 Windows 7 上安装 cairo-0.12.4 Haskell 软件包。我首先下载并解压 Gtk+2 并将其 bin 子目录添加到 PATH 中。然后我尝试使用额外的库运行 cabal 并包括:

cabal --extra-lib-dirs="d:\Program Files (x86)\Gtk+\lib" 
      --extra-include-dirs="d:\Program Files (x86)\Gtk+\include" install

但我收到以下错误

 Reading available packages...
 Choosing modular solver.
 Resolving dependencies...
 Ready to install cairo-0.12.4
 Waiting for install task to finish...
 Extracting
 C:\Users\abailly\AppData\Roaming\cabal\packages\hackage.haskell.org\cairo\0.12.4\cairo-0.12.4.tar.gz
 to C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368...
 Updating cairo.cabal with the latest revision from the index.
 creating
 C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup
 creating
 C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist
 creating
 C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup
 d:\Program Files (x86)\Haskell Platform\2012.2.0.0\bin\ghc.exe --make C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-
 0.12.4\Setup.hs -o C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup\setup.exe -odir C:\Users\abailly\
 AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup -hidir C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.
 12.4\dist\setup -i -iC:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4 -package Cabal-1.14.0
 [1 of 2] Compiling SetupWrapper     ( C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\SetupWrapper.hs, C:\Users
 \abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup\SetupWrapper.o )
 [2 of 2] Compiling Main             ( C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\Setup.hs, C:\Users\abaill
 y\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup\Main.o )
 Linking C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup\setup.exe ...
 C:\Users\abailly\AppData\Local\Temp\cairo-0.12.4-2368\cairo-0.12.4\dist\setup\setup.exe
 configure --verbose=2 --ghc --prefix=C:\Users\abailly\AppData\Roaming\cabal
 --user --flags=cairo_svg --flags=cairo_ps --flags=cairo_pdf
 --extra-include-dirs=D:\Program Files (x86)\Gtk+\include
 --extra-lib-dirs=D:\Program Files (x86)\Gtk+\lib --constraint=mtl ==2.1.2
 --constraint=bytestring ==0.9.2.1 --constraint=base ==4.5.0.0
 --constraint=array ==0.4.0.0 --disable-tests --disable-benchmarks
 [1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist\setup-wrapper\Gtk2HsSetup.o )
 [2 of 2] Compiling Main             ( SetupMain.hs, dist\setup-wrapper\Main.o )
 Linking dist/setup-wrapper\setup.exe ...
 Configuring cairo-0.12.4...
 Flags chosen: cairo_svg=True, cairo_ps=True, cairo_pdf=True
 Dependency array ==0.4.0.0: using array-0.4.0.0
 Dependency base ==4.5.0.0: using base-4.5.0.0
 Dependency bytestring ==0.9.2.1: using bytestring-0.9.2.1
 Dependency mtl ==2.1.2: using mtl-2.1.2
 Dependency cairo-pdf -any: using version 1.10.2
 Dependency cairo-ps -any: using version 1.10.2
 Dependency cairo-svg -any: using version 1.10.2
 Dependency cairo >=1.2.0: using version 1.10.2
 Using Cabal-1.14.0 compiled by ghc-7.4
 Using compiler: ghc-7.4.1
 Using install prefix: C:\Users\abailly\AppData\Roaming\cabal
 Binaries installed in: C:\Users\abailly\AppData\Roaming\cabal\bin
 Libraries installed in:
 C:\Users\abailly\AppData\Roaming\cabal\cairo-0.12.4\ghc-7.4.1
 Private binaries installed in:
 C:\Users\abailly\AppData\Roaming\cabal\cairo-0.12.4
 Data files installed in: C:\Users\abailly\AppData\Roaming\cabal\cairo-0.12.4
 Documentation installed in:
 C:\Users\abailly\AppData\Roaming\cabal\doc\cairo-0.12.4
 Using alex version 3.0.1 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\lib\extralibs\bin\alex.exe
 Using ar found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\mingw\bin\ar.exe
 No c2hs found
 Using cpphs version 1.16 found on system at:
 c:\Users\abailly\AppData\Roaming\cabal\bin\cpphs.exe
 No ffihugs found
 Using gcc version 4.5.2 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\mingw\bin\gcc.exe
 Using ghc version 7.4.1 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\bin\ghc.exe
 Using ghc-pkg version 7.4.1 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\bin\ghc-pkg.exe
 No greencard found
 Using gtk2hsC2hs version 0.13.6 found on system at:
 c:\Users\abailly\AppData\Roaming\cabal\bin\gtk2hsC2hs.exe
 Using gtk2hsHookGenerator found on system at:
 c:\Users\abailly\AppData\Roaming\cabal\bin\gtk2hsHookGenerator.exe
 Using gtk2hsTypeGen found on system at:
 c:\Users\abailly\AppData\Roaming\cabal\bin\gtk2hsTypeGen.exe
 Using haddock version 2.10.0 found on system at: d:\Program Files
 (x86)\Haskell Platform\2012.2.0.0\bin\haddock.exe
 Using happy version 1.18.9 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\lib\extralibs\bin\happy.exe
 No hmake found
 Using hpc version 0.6 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\bin\hpc.exe
 Using hsc2hs version 0.67 found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\bin\hsc2hs.exe
 Using hscolour version 1.20 found on system at:
 c:\Users\abailly\AppData\Roaming\cabal\bin\HsColour.exe
 No hugs found
 No jhc found
 Using ld found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\mingw\bin\ld.exe
 No lhc found
 No lhc-pkg found
 No nhc98 found
 Using pkg-config version 0.26 found on system at: d:\Program Files
 (x86)\Gtk+\bin\pkg-config.exe
 Using ranlib found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\mingw\bin\ranlib.exe
 Using strip found on system at: d:\Program Files (x86)\Haskell
 Platform\2012.2.0.0\mingw\bin\strip.exe
 Using tar found on system at: D:\Program Files (x86)\Git\bin\tar.exe
 No uhc found
 d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-pdf
 d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-ps
 d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-svg
 d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo
 setup.exe: Missing dependencies on foreign libraries:
 * Missing C libraries: z, cairo
 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.
 Failed to install cairo-0.12.4
 cabal.exe: Error: some packages failed to install:
 Chart-0.16 depends on cairo-0.12.4 which failed to install.
 cairo-0.12.4 failed during the configure step. The exception was:
 ExitFailure 1
 splot-0.3.8 depends on cairo-0.12.4 which failed to install.

当我尝试直接安装 cairo 时,我得到以下信息:

d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-pdf
d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-ps
d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo-svg
d:\Program Files (x86)\Gtk+\bin\pkg-config.exe --modversion cairo
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: z, cairo
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.
Failed to install cairo-0.12.4
World file is already up to date.
cabal.exe: Error: some packages failed to install:
cairo-0.12.4 failed during the configure step. The exception was:
ExitFailure 1

我一无所知...

最佳答案

如果您阅读错误消息:

* Missing C libraries: z, cairo

它表示您需要安装 libz 和 cairo 库的库(和头文件)。在 *nix 系统上,这通常意味着只需使用包管理器安装这些包的 -dev 版本。在 Windows 上,我假设您会下载该库的源版本并安装。

关于haskell - 无法在 Windows 上安装 cairo haskell 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15177540/

相关文章:

algorithm - 如何为字符串列表编写 Haskell BFS 算法

Haskell 工具重写 import 语句来命名所有导入?

haskell - 如何在 Haskell 中获取已创建进程的进程 ID?

haskell - 解释这个haskell函数 "list of tuples to list"

haskell - 由于缺少依赖项,堆栈构建失败

python - 如何使用 PyGTK 和 PyCairo 在窗口中获得透明背景?

haskell - 该包间接依赖于多个版本...阻止使用 ghci

cabal - mac 上的 Haskell 平台将 cabal 安装在/usr/bin 中,但是 cabal 安装在 ~/Library/Haskell 中

c++ - 在 win32 (C++) 中打开、操作和渲染 SVG 文件

python - 如何从 cairo.ImageSurface 获取像素?