0

我正在尝试使用 cabal 在 Windows 上安装 Haskell 的GD 库,但我从 GCC 收到以下错误:

解决依赖关系...
配置 gd-3000.6.1...
预处理库gd-3000.6.1...
构建gd-3000.6.1...
[1 of 4] 编译 Graphics.GD.Internal ( dist\build\Graphics\GD\Internal.hs, dist\build\Graphics\GD\Internal.o )
[2 of 4] 编译 Graphics.GD.ByteString.Lazy ( Graphics\GD\ByteString\Lazy.hs, dist\build\Graphics\GD\ByteString\Lazy.o )
[3 of 4] 编译 Graphics.GD.ByteString ( Graphics\GD\ByteString.hs, dist\build\Graphics\GD\ByteString.o )
[4 of 4] 编译 Graphics.GD ( dist\build\Graphics\GD.hs, dist\build\Graphics\GD.o ) cbits\gd-extras.c:在函数 `gdImagePtrDestroyIfNotNull' 中:

cbits\gd-extras.c:10:0:
     内部编译器错误:在 rest_of_handle_final 中,位于 toplev.c:2067
请提交完整的错误报告,
如果合适,使用预处理的源。
有关说明,请参阅 <URL:http://www.mingw.org/bugs.shtml>。
cabal:错误:某些软件包无法安装:
gd-3000.6.1 在构建阶段失败。例外是:
退出失败 1

谷歌搜索“rest_of_handle_final toplev.c 2067”会因为其他库的类似问题而获得多次点击,以及GCC 错误 #23589的链接。最新的 Haskell Platform for Windows (2010.2.0.0) 带有 GHC 6.12.3 和 gcc 3.4.5,那么我该如何解决这个问题呢?我可以强制 cabal 以某种方式使用更新版本的 gcc(我通过 MinGW 有 gcc 4.5.2),这会有所帮助吗?

如果有人在 Windows 上成功编译了 GD 库,我可以使用一些技巧。

4

1 回答 1

1

三种可能的解决方案,有些您可能不喜欢:

  1. 用于cabal install --with-gcc=...选择所需的 gcc。
  2. 使用可能有更新的 gcc 的最新 Haskell 平台(页面没有说明)。
  3. 使用带有包管理器的操作系统,这样您就不必依赖 Haskell 编译器与 C 编译器紧密耦合,而 C 编译器可能不太愿意更新。
于 2011-03-17T01:46:09.420 回答