1

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?

Michael
  • 3,411
  • 4
  • 25
  • 56
  • Looks like its an OS mismatch. You're running windows, GNU readline is probably only included on POSIX systems. Have you tried building/installing the [GNU readline application for windows](http://gnuwin32.sourceforge.net/packages/readline.htm)? – hnefatl Jan 07 '18 at 23:05
  • Just installed it and tried it out. The same error occurs. – Michael Jan 07 '18 at 23:11
  • 1
    Doesn't seem like readline is officially supported on windows. The homepage says it has to be installed through cygwin. – Qwertie Jan 08 '18 at 04:05
  • Okay I'll have a look at installing it through that tonight and see how I go thank you! – Michael Jan 08 '18 at 11:07

1 Answers1

2

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.

sclv
  • 38,665
  • 7
  • 99
  • 204