堆栈的读取依赖性错误

时间:2017-04-03 13:16:54

标签: haskell haskell-stack

将此依赖项添加到project.cabal文件时出现此错误。

Warning: defaultUserHooks in Setup script is deprecated.
Configuring readline-1.0.3.0...
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/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... no
checking for rl_readline_version... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.

我必须做些什么来解决这个问题?

1 个答案:

答案 0 :(得分:1)

说你在OSX上

$ brew install readline
[...]
For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/readline/lib
    CPPFLAGS: -I/usr/local/opt/readline/include

现在您知道库的安装位置,您可以设置一些./configure将会选择的环境变量

LDFLAGS=-L/usr/local/opt/readline/lib \
CFLAGS=-I/usr/local/opt/readline/include \
stack install readline --extra-include-dirs=/usr/local/opt/readline/include --extra-lib-dirs=/usr/local/opt/readline/lib