简体   繁体   中英

using gloss error unknown GLUT entry glutInit

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM