
Am 17.03.2014 10:22, schrieb Simon Marlow:
On 11/03/2014 22:11, Henning Thielemann wrote:
I am trying to understand the following linker message. I have started GHCi, loaded a program and try to run it:
Main> main ... Loading package poll-0.0 ... linking ... done. Loading package alsa-seq-0.6.0.3 ... can't load .so/.DLL for: /var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so
(/var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so:
undefined symbol: alsazmseqzm0zi6zi0zi3_SystemziPosixziPoll_zdfStorableFd_closure)
I assume that GHCi wants to say the following: The instance Storable Fd defined in module System.Posix.Poll cannot be found in the shared object file of the alsa-seq package. That's certainly true because that module is in the package 'poll' and not in 'alsa-seq'. But 'alsa-seq' imports 'poll'. What might be the problem?
It seems to have the idea that System.Posix.Poll is part of the alsa-seq package. Perhaps you have a copy of that module on the search path somewhere, or inside the alsa-seq package?
This would confirm how I understood the linker message. Then I guess that compiling all packages at once in a single build dir with cabal was the problem. The command line was like: $ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll alsa-seq pkg1 pkg2 pkg3 ... After compiling the packages separately the problem has gone.