I've got the following situation:
- Library X is a wrapper over some code in C.
- Library A depends on library X.
- Library B uses Template Haskell and depends on library A.
GHC bug #9010 makes it impossible to install library B using GHC 7.6. When TH is processed, GHCi fires up and tries to load library X, which fails with a message like
Loading package charsetdetect-ae-1.0 ... linking ... ghc:
~/.cabal/lib/x86_64-linux-ghc-7.6.3/charsetdetect-ae-1.0/
libHScharsetdetect-ae-1.0.a: unknown symbol `_ZTV15nsCharSetProber'
(the actual name of the “unknown symbol” differs from machine to machine).
Are there any workarounds for this problem (apart from “don't use Template Haskell”, of course)? Maybe library X has to be compiled differently, or there's some way to stop it from loading (as it shouldn't be called during code generation anyway)?
-lyourlibname
option to ghci where libyourlibname.so is the library X wraps. – n. 1.8e9-where's-my-share m.libyourlibname.so
– all code that is wrapped by library X is contained in library X itself. – Artyomghc --make
does. You may want to try that. Alternatively, refactor the code so that your TH stuff doesn't depend on anything that contains C code. Pass any wrapped C APIs to the functions in your TH module as parameters. – n. 1.8e9-where's-my-share m.