Trouble with GHCi and HOpenGL

Hi! I've installed HOpenGL (using cygwin and windows 2000). But when I try to run ghci with HOpenGL I just get these error messages:
ghci -package HOpenGL
/ _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.04, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package lang ... linking ... done. 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? When I run ">ghc an_HOpenGl_program.hs -package HOpenGL" everything works and I can run the compiled program, but why doesn't ghci work ? Can it have someghing to do with this error message I got when I built HOpenGL: ... 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 ? Reading package info from stdin... done. Expanding embedded variables...done. warning: can't find GHCi lib `HOpenGL.o' <--- Why, again?? Does anyone know how to get ghci working with HOpenGL? Sorry if this question is stupid - I'm a student and am learning Haskell right now...

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.
participants (2)
-
Magnus Lindberg
-
Sven Panne