using gloss error unknown GLUT entry glutInit

718 views Asked by At

Hey I am trying to use gloss library but I always get this error: Exception: user error (unknown GLUT entry glutInit) This is my code:

module Pruebas where

import Graphics.Gloss

window :: Display
window = InWindow "Nice Window" (200, 200) (10, 10)

background :: Color
background = white

drawing :: Picture
drawing = circle 80

final :: IO ()
final = display window background drawing 

I know that there are similar questions but I haven't been able to find a solution there. Thanks

2

There are 2 answers

0
Emad Pourhassani On

You have to have GLUT installed for some smaller openGL programs to function.If your using linux insalling freeglut will do the trick otherwise This could help you install GLUT you can also check here for more information.

0
user12899688 On

On Windows it just seems to need the glut32.dll. I had exactly the same problem and I could finally solve it with that dll. Just put it next to your executable or in the same folder as you are running your command (like cabal-repl) if you're using ghci.