Search code examples
user-interfacehaskellcabalgloss

Run haskell gloss GUI using cabal


I am new to haskell and I want to learn how to create GUIs using the haskell platform. I found this tic tac toe example but I can't seem to figure it out how to run it.

https://github.com/DevJac/gloss-tic-tac-toe

I runned Setup.hs, it compiled but nothing happend. Tried cabal run and this is the output:

Package has never been configured. Configuring with default flags. If this fails, please run configure manually. Resolving dependencies... Configuring gloss-tic-tac-toe-0.1.0.0... cabal: At least the following dependencies are missing: base ==4.7.*, gloss >=1.9.2.1 && <1.10

Any ideas?


Solution

  • Update:

    Here's what I did to get it to compile:

    1. First run cabal install gloss-examples

    It will take a while as it will install a lot of dependencies. These dependencies are also needed for the tic-tac-toe program.

    1. Then do this:

      git clone https://github.com/DevJac/gloss-tic-tac-toe cd gloss-tic-tac-toe

    and change the build-depends stanza in the .cabal file to read:

      build-depends:       base       >= 4.7,
                           gloss      >= 1.9.2.1,
                           containers >= 0.5.5.1
    

    Basically just remove all upper bounds.

    1. Run cabal build

    2. If the build succeeds, run the executable:

      ./dist/build/gloss-tic-tac-toe/gloss-tic-tac-toe