[HOpenGL] Trouble with GHCi and HOpenGL

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Thu, 03 Oct 2002 14:11:03 +0200


Magnus Lindberg wrote:
 > [...]
 >  / /_\// /_/ / /  | |      GHC Interactive, version 5.04, for Haskell

Not really HOpenGL-related, but anyway: I'd really recommend using
5.04.1 instead of 5.04. Quite a few bugfixes went into this patchlevel.

 > [...]
 > Loading package HOpenGL ... C:\Program\Haskell\ghc-5.04\bin\ghc.exe:
 > can't load .so/.DLL for: HOpenGL (addDLL: unknown error)
 >
 > What does this mean?

This means that GHC can't find HOpenGL.o and falls back to HOpenGL.so
(HOpenGL.dll on WinDoze), which it can't find either. The standard build
process of HOpenGL only yields a libHOpenGL.a for use with GHC, not a
HOpenGL.o for GHCi.

 > [...]
 > package=HOpenGL || true ; \
 >    "/cygdrive/c/Program/Haskell/ghc-5.04/bin/ghc-pkg" --config-file=""
 > --force --add-package < HOpenGL.conf ; \
 > fi
 > package `HOpenGL' not installed               <--- Why ?

That's perfectly OK, because ghc-pkg only tries to tell you that no
prior version of HOpenGL is installed.

 > Reading package info from stdin... done.
 > Expanding embedded variables...done.
 > warning: can't find GHCi lib `HOpenGL.o'      <--- Why, again??

As already said above, GHCi is not supported out-of-the box. You could
try adding --auto-ghci-libs after the --add-package, which generates a
HOpenGL.o from libHOpenGL.a. But I've never tried this on WinDoze.

A last remark: glutMainLoop's behaviour of never returning makes it a
little bit useless in an interactive environment. An interface with a
simple one-shot dispatch would be very helpful here, but GLUT doesn't
offer such a thing. You could easily hack one into it, but then you
would have to use your own modified version of GLUT. :-(

Cheers,
    S.