我正在尝试使用cabal在Windows上为Haskell安装GD library,但是我从GCC收到以下错误:
Resolving dependencies... Configuring gd-3000.6.1... Preprocessing library gd-3000.6.1... Building gd-3000.6.1... [1 of 4] Compiling Graphics.GD.Internal ( dist\build\Graphics\GD\Internal.hs, dist\build\Graphics\GD\Internal.o ) [2 of 4] Compiling Graphics.GD.ByteString.Lazy ( Graphics\GD\ByteString\Lazy.hs, dist\build\Graphics\GD\ByteString\Lazy.o ) [3 of 4] Compiling Graphics.GD.ByteString ( Graphics\GD\ByteString.hs, dist\build\Graphics\GD\ByteString.o ) [4 of 4] Compiling Graphics.GD ( dist\build\Graphics\GD.hs, dist\build\Graphics\GD.o ) cbits\gd-extras.c: In function `gdImagePtrDestroyIfNotNull': cbits\gd-extras.c:10:0: internal compiler error: in rest_of_handle_final, at toplev.c:2067 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.mingw.org/bugs.shtml> for instructions. cabal: Error: some packages failed to install: gd-3000.6.1 failed during the building phase. The exception was: ExitFailure 1
谷歌搜索“rest_of_handle_final toplev.c 2067”获得了几个与其他库类似问题的点击,以及GCC bug #23589的链接。最新的Windows Haskell平台(2010.2.0.0)附带GHC 6.12.3和gcc 3.4.5,那我怎么能解决这个问题呢?我可以强迫cabal以某种方式使用更新版本的gcc(我通过MinGW使用gcc 4.5.2),这会有帮助吗?
如果有人在Windows上成功编译了GD库,我可以使用一些提示。
答案 0 :(得分:1)
三种可能的解决方案,一些您可能不喜欢的解决方案:
cabal install --with-gcc=...
选择所需的gcc。