I'm new to Haskell, I'm trying to use a library called graphics.gloss but I keep getting this error and I'm not sure what is the problem exactly.

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.

Thank you in advance


Solution 1:

The version of base is tied to the version of GHC. It looks like you're on GHC 9.2, which a lot of libraries still don't support yet. You can try passing --allow-newer to cabal, but I expect that to cause other problems. Downgrade to an older major version of GHC instead.