如何在Windows上安装Haskell模块encoding-0.6.3?

3

我的操作系统是Windows 7,安装了Haskell平台6.12。

HaXml和其他依赖已经安装好了。

我尝试在下载后执行以下操作:

runHaskell Setup.hs configure 

并且:

runHaskell Setup.hs configure 
--extra-include-dirs=F:/language/langer/haskell/encoding-0.6.3 
--extra-lib-dirs=F:/language/langer/haskell/encoding-0.6.3

并使用Cabal:

cabal install encoding

但以上所有内容均打印:
* Missing header file: system_encoding.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.

我已经在Cygwin、MINGW和MSDOC上尝试过了,但都失败了。 在大量搜索后,我发现this(haskll-cafe和google-group具有相同的内容) 他们提到了“langinfo.h”,我在Cygwin的“/usr/include”目录下找到了这个文件。但仍然无法工作。 有人在Windows上成功安装了encoding-0.6.3吗?

在某些版本中,Haskell 的 Windows 安装程序存在一个 bug,未能将一些 C 头文件放置在正确的位置。我进行了谷歌搜索,在这种特定情况下,一个 Q'n'D 解决方案是将目录 extralibs$inst$\libs\ 复制到 $inst$ 中($inst$ 是 Haskell 平台安装的位置)。 - Dario
2个回答

1

在Windows上构建它只需要向cabal install命令传递-f-systemEncoding标志即可。


1

我不得不将这个作为答案发布以保持格式,尽管它实际上是一条评论,因为我自己不会按照这些步骤操作:

可能你可以通过libgw32c库在MinGW上安装"langinfo.h" - 这个页面上有一些说明,但它们看起来很具侵入性,而且不是我想要做的事情(我喜欢尽可能保持MSYS的干净):

http://placella.com/software/zenity/

另外,这里有一个补丁 - 但是阅读评论后,这似乎又是一种侵入性的方法,而且不是我想要运行的东西(我喜欢尽可能保持我的 GHC 安装干净):

http://dmwit.com/wyvern/encoding_ffi.dpatch


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接