[Haskell-cafe] Re: [Haskell] GHC 6.10 and OpenGL

Pekka Karjalainen p3k at iki.fi
Tue Dec 2 14:33:23 EST 2008


On Tue, Dec 2, 2008 at 6:55 PM, Claus Reinke <claus.reinke at talk21.com> wrote:
> I finally got round to trying cabal-install with OpenGL/GLUT,
> using a freshly built ghc head, a cygwin bash, and
[...]

>   C:\Program
> Files\Haskell\GLUT-2.1.1.2\ghc-6.11.20081202/libHSGLUT-2.1.1.2.a(Window.o):fake:
> (.text+0x15): undefined reference to `glutWarpPointer'
[...]

I believe these errors are caused by the wrong calling convention
being used in the Haskell bindings. This part in the configure script
tests the build (host) platform:

case "$host" in
*-mingw32) CALLCONV=stdcall ;;
*)      CALLCONV=ccall ;;
esac

Since it doesn't test for Cygwin, you end up with the calling
convention being ccall, which leads to the linker errors because of
associated name mangling (you would also see run-time crashes if you
managed to somehow link your program).

Pekka


More information about the Haskell-Cafe mailing list