I’m on Ubuntu 11.10 using ghc version 7.0.3.20110330, running “current-version updates” of nvidia display driver. You can reproduce by running:
curl http://ix.io/1t6 > Stroke.hs; ghc --make Stroke.hs; ./Stroke
...
Stroke: user error (unknown GLU entry gluOrtho2D)
But I can run opengl and it works fine. I tried glxgears and it ran fine and I ran an opengl benchmark and it worked fine as well.
Versions of haskell opengl libs
result of running:
for p in OpenGL OpenGLRaw GLURaw; do ghc-pkg latest $p; done
OpenGL-2.4.0.1
OpenGLRaw-1.1.0.1
GLURaw-1.1.0.0
This is a definite bug. There is a problem with the linker (and I’m not sure if this is specific to 11.10 or to GHC 7.0+). Here’s how it was explained to me: the linker essentially decides that, since you’re not linking statically to libglut, it will just optimize by not linking your executable to it at all. You can get around this by applying the following patch to GLURaw 1.1.0.0:
Run
cabal installon GLURaw after applying this patch, and it should get rid of this problem.