[Haskell-cafe] Fwd: Executable runs but dynamic linking fails within ghci

Ryan G rgoggans at gmail.com
Thu Aug 25 19:05:43 UTC 2016


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/2fbff384e9637e1c1763c65a5f843b8fc36b1fea/src/Graphics/GLU/Functions.hs#L91> and
> the C part
> <https://github.com/haskell-opengl/GLURaw/blob/2fbff384e9637e1c1763c65a5f843b8fc36b1fea/cbits/HsGLURaw.c#L77>.
> For some reason, dlsymdoesn't find the GLU entries when running under
> GHCi, while the compiled version does.
>
Any help is appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160825/212068d3/attachment.html>


More information about the Haskell-Cafe mailing list