haskell - 如何在 Cygwin 下安装 Haskell readline?

标签 haskell cygwin readline

这是我尝试通过 cabal-install 安装时收到的消息:

$ cabal install --extra-include-dirs="C:\no_spaces\cygwin\usr\include" --extra-lib-dirs="C:\no_spaces\cygwin\lib" readline
Resolving dependencies...
Configuring readline-1.0.1.0...
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for rl_readline_version... yes
checking for rl_begin_undo_group... yes
checking for rl_erase_empty_line... yes
checking for rl_free_undo_list... yes
checking for rl_completion_word_break_hook in -lreadline... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating readline.buildinfo
config.status: creating include/HsReadlineConfig.h
config.status: include/HsReadlineConfig.h is unchanged
cabal.exe: Missing dependencies on foreign libraries:
* Missing header file: HsReadline.h
* Missing C libraries: readline, ncurses
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.
cabal.exe: Error: some packages failed to install:
readline-1.0.1.0 failed during the configure step. The exception was:
ExitFailure 1

我有 readline.h 之类的东西,显然它似乎找到了它们。缺少 HsReadline.h 是一个问题,这似乎很奇怪:这不是我要安装的软件包的一部分吗?

任何有关如何实现此功能的建议将不胜感激。我花了几天时间尝试让它工作,无论是在 gnuWin32 readline、MinGW 还是 cygwin 下。

最佳答案

我大胆猜测,导致 Cygwin 失败的是 DOS/Windows 风格的路径:“C:\no_spaces\cygwin\usr\include”

尝试在 Cygwin shell 中导航到这些文件。它可能看起来像“/cygdrive/c/no_spaces/cygwin/usr/include”

有关 HsReadline.h 的消息可能是转移注意力。真正的问题是 Cabal 找不到要编译的底层开发库。

关于haskell - 如何在 Cygwin 下安装 Haskell readline?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3574435/

相关文章:

haskell - 为什么 enum 类型类不是 ord 类型类的子类?

haskell - 记录的字段可以与某个值匹配并同时分配给一个参数吗?

haskell - Cabal 在需要分析库时不安装依赖项?

linux - 运行 sh 脚本给出未找到任何 UNIX/Linux 基本命令的命令

C# - SerialPort.ReadLine() 卡住我的程序

Delphi:使用 Reset/ReadLn 读取文本文件的替代方法

algorithm - 测试一个整数是否为质数

bash - 在 Cygwin 上加速文件比较(与 `cmp` )?

诅咒将光标 move 到非空白位置

c# - ReadLine() 无法读取整行