haskell - linking extra libraries/objects failed -
haskell - linking extra libraries/objects failed -
i made ffi bindings c++ unordered_map(a.k.a. hash_map) container , wrapper library called libstl.a
. @ first time, used work well. after point, has failed link library next error messages , can't figure out why.
$ ghci -l. -lstl -lstdc++ ghci, version 7.6.2: http://www.haskell.org/ghc/ :? help loading bundle ghc-prim ... linking ... done. loading bundle integer-gmp ... linking ... done. loading bundle base of operations ... linking ... done. loading object (static archive) ./libstl.a ... done loading object (dynamic) /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so ... done final link ... ghc: ./libstl.a: unknown symbol `_zznkst8__detail20_prime_rehash_policy11_m_next_bkteme10__fast_bkt' linking libraries/objects failed
source codes library located in https://github.com/comatose/stl-container. help appreciated.
i've had similar problems loading .o files ghci. understand, problem g++ leaves 'weak symbols' in .o files, , ghci doesn't deal them well.
i found thread helpful follow-up:
http://www.haskell.org/pipermail/haskell-cafe/2012-march/099926.html
in suggested solution set compiled g++ shared libraries (.so files instead of .a), , seems clear weak symbol problem. shared libraries can bit of pain. suggest @ libtool. it's helper programme can handle lot of complications:
http://www.gnu.org/software/libtool/
haskell ffi ghci
Comments
Post a Comment