在Windows中安装Haskell terminfo

在Windows中安装Haskell terminfo,haskell,cabal-install,Haskell,Cabal Install,我正试图在我的Windows Cygwin安装中安装terminfocabal软件包,但由于curses标题,安装失败: $ cabal install terminfo Resolving dependencies... Configuring terminfo-0.3.2.5... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking for gcc... gcc checking whe

我正试图在我的Windows Cygwin安装中安装
terminfo
cabal软件包,但由于
curses
标题,安装失败:

$ cabal install terminfo
Resolving dependencies...
Configuring terminfo-0.3.2.5...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
...
checking ncurses.h usability... no
checking ncurses.h presence... no
checking for ncurses.h... no
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
configure: error: in `/tmp/terminfo-0.3.2.5-620/terminfo-0.3.2.5':
configure: error: curses headers could not be found, so this package cannot be built
See `config.log' for more details
Failed to install terminfo-0.3.2.5
cabal.exe: Error: some packages failed to install:
terminfo-0.3.2.5 failed during the configure step. The exception was:
ExitFailure 1
同时,正确安装了NCurses(
/usr/include/ncursesw
NCurses
)。 如果在编译之前我显式地将该子文件夹添加到GCC,它将继续

export C_INCLUDE_PATH=/usr/include/ncursesw
重新运行阴谋集团产生了另一个错误:

...
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for setupterm in -lncursesw... yes
configure: creating ./config.status
config.status: creating terminfo.buildinfo
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
cabal.exe: Missing dependency on a foreign library:
* Missing (or bad) header file: ncurses.h
* Missing C library: ncursesw
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.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Failed to install terminfo-0.3.2.5
cabal.exe: Error: some packages failed to install:
terminfo-0.3.2.5 failed during the configure step. The exception was:
ExitFailure 1

所以我尝试了cabal安装terminfo--extra-lib-dirs=/lib/ncursesw,但后来我意识到cabal是一个windows应用程序,所以我也尝试了
--extra-lib-dirs=c:/cygwin/lib/ncursesw

最后,最终解决方案如下:

  • 在那里安装Cygwin和
    ncursesw-devel
    软件包
  • 运行cygwin并配置GCC:
    $export C\u INCLUDE\u PATH=/usr/INCLUDE/ncursesw
  • 由于
    C:\cygwin\usr\include\ncursesw\ncurses.h
    是cygwin中的软引用,因此您应该手动将该文件替换为同一文件夹中的
    curses.h
  • 现在,您可以从同一个Cygwin终端启动Cabal(这是一个Windows程序!):

    $cabal安装终端fo--extra-lib-dirs=c:/cygwin/lib--extra-include-dirs=c:/cygwin/usr/include/ncursesw--extra-include-dirs=c:/cygwin/usr/include

  • 因此,安装了库。但当我尝试实际使用该功能时,ghc抱怨:

    Loading package terminfo-0.3.2.5 ... linking ... ghc.exe: c:/cygwin/lib\libncursesw.a: unknown symbol `__imp____ctype_ptr__'