如何使用Cabal安装本地库



我是哈斯克尔的初学者,正在学习Hudak的书《哈斯克尔表达学派》。我正在研究图形章节,并找到了该书图形库的更新版本:https://github.com/noughtmare/haskell-school-of-expression.然而,当我运行cabal v1-build时,我会得到

Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: SOE-0.1.0.0 (user goal)
[__1] next goal: base (dependency of SOE)
[__1] rejecting: base-4.12.0.0/installed-4.12.0.0 (conflict: SOE => base>=4.13
&& <4.15)
[__1] fail (backjumping, conflict set: SOE, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: SOE, base
Trying configure anyway.
Configuring SOE-0.1.0.0...
cabal-3.6.2.0.exe: Encountered missing or private dependencies:
GLFW-b, base >=4.13 && <4.15, freetype2, old-time

我知道base只是哈斯克尔的前奏曲,我知道我有,所以我不知道在这里该做什么。谢谢

您看到的特定错误是因为您安装的GHC版本与该软件包不兼容。

原因是base软件包版本被锁定到特定的GHC版本,因此您不能将较新版本的base与较旧版本的GHC一起使用。请参阅此wiki页面以获取每个基本版本的相应GHC版本的列表。

您可以升级到较新的GHC版本,如8.10.7。

另一种选择是用--allow-older=base来管理阴谋集团。

现在我实际上已经更新了这个包,将下限从4.13更改为4.12,所以如果你提取最新的更改,它应该编译得很好。

此外,我建议使用默认的v2-build,但这与您看到的错误没有直接关系。

最新更新