[Haskell-cafe] Undefined symbols when trying to use SDL-mixer

Peter Reiner Fels prfels at googlemail.com
Thu Jan 15 20:36:57 UTC 2015


I'm trying to use SDL-mixer v0.6.1. When I add a dependency to my cabal file
and run cabal repl I get the following error:

Loading package SDL-mixer-0.6.1 ... <command line>: can't load .so/.DLL for:
/home/prf/haskell/link-problem/.cabal-sandbox/lib/x86_64-linux-ghc-7.8.3/SDL-mi
xer-0.6.1/libHSSDL-mixer-0.6.1-ghc7.8.3.so
(/home/prf/haskell/link-problem/.cab
al-sandbox/lib/x86_64-linux-ghc-7.8.3/SDL-mixer-0.6.1/libHSSDL-mixer-0.6.1-ghc7
.8.3.so: undefined symbol: Mix_FreeChunk)

I can see these undefined symbols when I run:
nm -D SDL-mixer-0.6.1/libHSSDL-mixer-0.6.1-ghc7.8.3.so | grep Free
U Mix_FreeChunk
U Mix_FreeMusic

Running ldd on this file and grepping for SDL gives
libHSSDL-0.6.5-ghc7.8.3.so =>
/home/prf/haskell/link-problem/.cabal-sandbox/lib
/x86_64-linux-ghc-7.8.3/SDL-0.6.5/libHSSDL-0.6.5-ghc7.8.3.so
(0x00007fb20b30600
0)
libSDL-1.2.so.0 => /usr/lib64/libSDL-1.2.so.0 (0x00007fb20a232000)

It seems like a dependency to /usr/lib64/libSDL_mixer.so is missing.

Line 1815 of SDL-mixer-0.6.1/configure contains the following definition of
SDL_LIBS:
    SDL_LIBS="-L`$SDL_CONFIG --prefix`/lib -lSDL_mixer"

This refers to the 32 bit lib directory, but I'm on a 64 bit system. I
unpacked SDL-mixer and changed this line to refer to the 64 bit lib
directory.
Next I recreated my cabal sandbox from scratch and added the patched version
of SDL-mixer as a dependency.
When I run cabal repl again I get the same error as mentioned above.

What am I doing wrong?
How do I get SDL-mixer to build against /usr/lib64/libSDL_mixer.so?

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150115/266c523f/attachment.html>


More information about the Haskell-Cafe mailing list