can't load .so/.DLL - undefined symbol

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's a rather big example that fails here, whereas the small examples in alsa-seq package work. Thus I first like to know what the message really means, before investigating further. I installed many packages at once with cabal-install using a single build directory, like: $ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll alsa-seq pkg1 pkg2 pkg3 ... ? Can this cause problems?

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? Cheers, Simon
It's a rather big example that fails here, whereas the small examples in alsa-seq package work. Thus I first like to know what the message really means, before investigating further. I installed many packages at once with cabal-install using a single build directory, like:
$ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll alsa-seq pkg1 pkg2 pkg3 ...
? Can this cause problems? _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

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.

Am 17.03.2014 15:33, schrieb Henning Thielemann:
Am 17.03.2014 10:22, schrieb Simon Marlow:
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.
I think I know what the problem was: 'poll' uses HSC as preprocessor, thus preprocessed files were stored in "dist". This way the preprocessed source files were available to GHC when compiling 'alsa' and thus it was compiled again, but not registered in the 'alsa' package.
participants (2)
-
Henning Thielemann
-
Simon Marlow