无法从终端运行 ghci

问题描述 投票:0回答:2

我正在尝试为项目的 Haskell 作业运行 ghci。但是它给了我这个错误消息:

/usr/local/haskell/ghc-8.2.1-x86_64/lib/ghc-8.2.1/bin/ghc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

我尝试使用ln制作一个符号libtinfo.so.5,但仍然不起作用。输入“locate libtinfo.so.5”给我以下信息:

/usr/lib/libtinfo.so.5

/usr/local/haskell/ghc-8.2.1-x86_64/lib/libtinfo.so.5

我正在运行 Manjaro Linux。

haskell ghci manjaro
2个回答
0
投票

运行以下命令:

$ sudo pacman-key --refresh-keys
$ gpg --keyserver pgp.mit.edu --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
$ yaourt -S ncurses5-compat-libs

然后尝试运行 GHCi


0
投票

运行

ghcup tool-requirements
获取 GHC 的隐式依赖项列表,然后通过我的操作系统的默认包管理器安装它们,这对我有用:

sudo apt install -y build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5

不要问我为什么它有效,或者为什么

ghc
ghcup
无法检测到这些依赖项缺失,或者为什么
ghcup
无法确保这些依赖项已正确安装,或者为什么错误消息如此之多完全没用。我非常讨厌这部分编程。

© www.soinside.com 2019 - 2024. All rights reserved.