以下程序:
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
main = do
(progname, _) <- getArgsAndInitialize
createWindow "Hello World"
mainLoop
使用命令编译:
ghc -package GLUT HelloWorld.hs -o HelloWorld
如本教程所述,无法在 OSX Lion 上执行,显示以下错误消息:
2013-09-07 20:31:20.372 aff[8561:60b] GLUT Warning: The following is a new check for GLUT 3.0; update your code.
2013-09-07 20:31:20.373 aff[8561:60b] GLUT Fatal Error: redisplay needed for window 1, but no display callback.