【问题标题】:How to install cairo on Windows如何在 Windows 上安装 cairo
【发布时间】:2018-12-06 04:29:12
【问题描述】:

我一辈子都不知道如何在 Windows 上安装 cairo!

Haskell Charts 我需要它,但是当我按照设置说明开始运行时:

cabal install gtk

我收到此错误:

Linking dist/setup-wrapper\setup.exe ...
Configuring glib-0.12.2...
setup.exe: The program pkg-config version >=0.9.0 is required but it could not
be found.
cabal.exe: Error: some packages failed to install:
cairo-0.12.2 failed during the configure step. The exception was:
ExitFailure 1
gio-0.12.2 depends on glib-0.12.2 which failed to install.
glib-0.12.2 failed during the configure step. The exception was:
ExitFailure 1
gtk-0.12.2 depends on glib-0.12.2 which failed to install.
pango-0.12.2 depends on glib-0.12.2 which failed to install.

如果我去cairo site,他们没有任何设置。只是一堆我不知道该怎么处理的dll(如何让Haskell看到它们)。

感谢任何帮助,因为我已经尝试安装该死的东西几个小时了!

【问题讨论】:

  • 错误看起来很明显(在上面的第三行):“setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found”。跨度>
  • 我认为安装路线需要一个完整的建筑环境。 DLL 的使用听起来很简单“只需将 libcairo-2.dll、libpng13.dll 和 zlib1.dll 弹出到您的工作目录或系统路径中”(来自您链接的 cairo 页面)。

标签: haskell cairo cabal


【解决方案1】:

您需要下载可用的多合一捆绑包here。您可以通过访问http://www.gtk.org/ 并单击“下载”,然后单击“Windows(32 位)”来自己发现此链接。将其解压缩到不包含空格的目录,然后将该目录添加到 PATH。在尝试cabal install gtk 之前,您还需要cabal install gtk2hs-buildtools

这些说明也可以在on the gtk2hs website找到。

【讨论】:

  • 这次我走得更远了——我设法安装了gtk!但是当我运行cabal install chart 时,我仍然得到:Loading package cairo-0.12.2 ... linking ... ghc.exe: C:\Users\drozzy\AppData\Roaming\cabal\cairo-0.12.2\ghc-7.0.4\HScai ro-0.12.2.o: unknown symbol '_cairo_image_surface_get_data' ghc.exe: unable to load package 'cairo-0.12.2' cabal.exe: Error: some packages failed to install: Chart-0.15 failed during the building phase. The exception was: ExitFailure 1
【解决方案2】:

我不是 100% 确定,但您可能需要这样做

cabal install gtk2hs-buildtools

在您安装 gtk 之前。

【讨论】:

  • 做到了。我的问题是我没有将指向 gtk bin 目录的链接放在我的路径中。但是,现在我遇到了另一个问题。请参阅我对@Daniel 答案的评论。
【解决方案3】:

自从本页上的答案发布以来,GTK 已停止发布 Windows 二进制文件。第三方在这里编译最新的dlls:http://www.tarnyko.net/dl/gtk.htm

【讨论】:

  • 嗯,我不认为 GTK 的人已经停止支持 Windows 或其他什么。他们还有a download page for Windows,只是建议使用MSYS2。我认为这很有意义,并且比手动安装 dll 文件更容易。
  • 看来他们已经把@leftaroundabout 提到的Windows 安装页面移到了这里:gtk.org/docs/installations/windows
猜你喜欢
  • 1970-01-01
  • 2012-02-01
  • 2013-02-17
  • 1970-01-01
  • 1970-01-01
  • 2011-09-03
  • 1970-01-01
  • 1970-01-01
  • 2011-07-17
相关资源
最近更新 更多