
I'm working with a GUI library and I can get everything to work when I run my executable. When I try to call my gui function within ghci, it crashes with: user error (unknown GLU entry gluOrtho2D). I'm on Arch running ghc version 7.10.3. The GLURaw maintainer could reproduce this and added some insight I can reproduce this both with LTS Haskell (based on GHC 7.10.3) and
Stackage nightly (based on GHC 8.0.1) on Ubuntu 16.04, too. This is somehow related to GHCi's dynamic linker, which has changed a few times in the past, and there are still issues with it. Alas, I don't remember the details, but perhaps you can get some answers on the haskell-cafe mailing list. All I can say is that things worked even within GHCi at some point in the past... [image: :wink:]
The gory details: Given an API entry name like "gluOrtho2D", the GLURaw package uses dlopen anddlsym to get the address of the function, see the Haskell part https://github.com/haskell-opengl/GLURaw/blob/2fbff384e9637e1c1763c65a5f843b... and the C part https://github.com/haskell-opengl/GLURaw/blob/2fbff384e9637e1c1763c65a5f843b.... For some reason, dlsymdoesn't find the GLU entries when running under GHCi, while the compiled version does.
Any help is appreciated