设置 graphics.gloss haskell

setting up graphics.gloss haskell

我是 Haskell 的新手,我正在尝试使用名为 graphics.gloss 的库 但是我一直收到这个错误,我不确定到底是什么问题。

PS E:\TicTacToeGame> cabal install base-4.2  
cabal.exe: Could not resolve dependencies:
[__0] trying: TicTacToeGame-0.1.0.0 (user goal)
[__1] trying: gloss-1.13.2.1 (dependency of TicTacToeGame)
[__2] next goal: bytestring (dependency of gloss)
[__2] rejecting: bytestring-0.11.1.0/installed-0.11.1.0 (conflict: gloss =>
bytestring>=0.10 && <0.11)
[__2] skipping: bytestring-0.11.2.0, bytestring-0.11.1.0, bytestring-0.11.0.0
(has the same characteristics that caused the previous version to fail:
excluded by constraint '>=0.10 && <0.11' from 'gloss')
[__2] trying: bytestring-0.10.12.1
[__3] next goal: base (dependency of TicTacToeGame)
[__3] rejecting: base-4.16.0.0/installed-4.16.0.0 (conflict: bytestring =>
base>=4.2 && <4.16)
[__3] skipping: base-4.16.0.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=4.2 && <4.16' from
'bytestring')
[__3] rejecting: base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__3] fail (backjumping, conflict set: TicTacToeGame, base, bytestring)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, bytestring, gloss, TicTacToeGame
Try running with --minimize-conflict-set to improve the error message.

提前致谢

base 的版本与 GHC 的版本相关联。看起来您使用的是 GHC 9.2,许多库仍然不支持。您可以尝试将 --allow-newer 传递给 cabal,但我希望这会导致其他问题。改为降级到较旧的 GHC 主要版本。