问题
I would like to install 'readline' using Cabal on Windows. When running the command it is saying that readline isn't found. Cabal is up to date.
Command
cabal install readline
Output
Resolving dependencies...
Notice: installing into a sandbox located at
C:\Users\Michael\Desktop\haskell-project\.cabal-sandbox
Configuring readline-1.0.3.0...
Failed to install readline-1.0.3.0
Build log ( C:\Users\Michael\Desktop\haskell-project\.cabal-sandbox\logs\readline-1.0.3.0.log ):
Configuring readline-1.0.3.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... no
checking for tputs in -ltermcap... no
checking for tputs in -lcurses... no
checking for rl_readline_version... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.
cabal: Error: some packages failed to install:
readline-1.0.3.0 failed during the configure step. The exception was:
ExitFailure 1
What could be the reason for this?
回答1:
If you are using an msys distro that includes pacman
(the one that ships with the windows haskell platform installer should be such a distro) then you can use pacman
to install the readline library, and this should let you link against it.
Also note that ghc ships with the haskeline
library, which is a pure-haskell replacement for readline that is more portable.
来源:https://stackoverflow.com/questions/48142369/how-to-install-readline-with-cabal-on-windows