0

I'm trying to install gloss on my computer to make a graphic game and I followed a tutorial, with these steps:

1) First I run this command: cabal install gloss==1.8.* . I want gloss 1.8.* because I found a game made with this version of gloss, and I understand that it is recommended to use the same version of gloss with which the game was made it. I have this on the cmd: installing gloss

2)Next, once gloss is installed, we have to tell cabal that our package is allowed to use it. I founnd the line in pong.cabal that mentions build-depends and change it to the following:

build-depends: base >=4.7 && <4.8, gloss==1.8.*

3) Finally, I wanted to run my .hs file(which contain the code to make a "nice window" with a circle) with the command: cabal run; the result of this command:

running .hs file

I don't understand why cabal can't find the gloss 1.8*. Anyone can help me with this problem?

sclv
  • 38,665
  • 7
  • 99
  • 204
Caroso
  • 111
  • 3
  • 12
  • 1
    Your step 1 failed so naturally step 3 will fail as well. Gloss 1.8.* was depends on an OLDER version of base than your version of GHC shipped with. – Thomas M. DuBuisson May 12 '16 at 16:49
  • i understand, but how can I find with which version of ghc, gloss 1.8.* works? – Caroso May 12 '16 at 16:52
  • The only way is sort of round-about. You look at the gloss 1.8.* 'base' dependency and see what that version is. The base version maps to a GHC version, so you can translate between the two. For example, I use GHC 7.10.3 which ships with base 4.8.2.0. – Thomas M. DuBuisson May 13 '16 at 05:18
  • The path I'd pick would be to try the library with gloss-1.10*. It might not require any changes beyond adjusting the version bound in the .cabal file. – Thomas M. DuBuisson May 13 '16 at 05:19

2 Answers2

2

Gloss 1.8.2.2 requires base 4.7.* (see the cabal file). The release notes for GHC 7.8.3 state that it comes with base 4.7.0.0.

Paul Johnson
  • 17,438
  • 3
  • 42
  • 59
  • It is a way now to install base 4.7 with cabal? Even if I have a newer version of ghc..or I have to uninstall haskell and look for an older version? – Caroso May 12 '16 at 17:58
  • Not really. Significant parts of base are tied to the version of GHC. But have you just tried compiling with an up-to-date verison of Gloss? Its going to be easier. – Paul Johnson May 12 '16 at 20:48
0

The package gloss 1.8.* depends on base 4.6 or base 4.7. Cabal sandbox is a good choice for you. You can initialize a sandbox, then install base 4.7 and gloss 1.8 in it.

sighingnow
  • 791
  • 5
  • 11