[HOpenGL] Installation (ok!), but ...

Claus Reinke claus.reinke at talk21.com
Mon May 2 14:51:14 EDT 2005


>1. You have to tell ghc, that you want the HOpenGl Package when you compile 
>some stuff that needs HOpenGL. You can do this with

in addition to the graphics (-package OpenGL), you also need some GUI,
most likely GLUT (-package GLUT), if you're compiling red book examples.

"ghc-pkg list" for ghc 6.4 should list "OpenGL-2.0, GLUT-2.0". as has been
pointed out already, these differ substantially from the early tarballs.

if you do "ghc-pkg describe GLUT", you'll see that the GLUT package
depends on the OpenGL package, so it is sufficient to specify "-package
GLUT" on the command line to get both.

even easier is to use "ghc --make", as that will now infer the packages 
that provide the modules you import, so you don't need to specify either
of GLUT/OpenGL explicitly on the command line. something like the 
following should work for the red book examples:

ghc --make <example>.hs -o <example>

you can find out what packages are installed and how to get access to
them here:

http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html

and the documentation for the OpenGL and GLUT packages is here:

http://www.haskell.org/ghc/docs/latest/html/libraries/index.html

cheers,
claus




More information about the HOpenGL mailing list