简体   繁体   中英

Haskell package linker error: can't load .so/.DLL for: clang

i guys i have a problem, i want to run a haskell script that imports libClang ( import Clang ), i made a cabal install libClang befor and it work

now when i make runhaskell foo.hs i get:

foo.hs: <command line>: can't load .so/.DLL for: clang (libclang.so: cannot open shared object file: No such file or directory)

i know that i have to add the library path to LD_LIBRARY_PATH so i add some paths to it because i dont know exactly which i have to use (should i use the lib path to the clang/llvm path or the lib path to the .cabal dir where my LibClang-9.0.0 is?)

so i got:

echo $LD_LIBRARY_PATH 
/home/foo/Downloads/clang+llvm-2.9-i686-linux/lib:/home/foo/.cabal/lib

after running runhaskell again, the same problem still extists, what should i do?

On Arch Linux, at least, clang installs into:

/usr/lib/llvm/libclang.a
/usr/lib/llvm/libclang.so

so the linker can find this library. You can also add paths to:

$ echo $LDFLAGS 
-L/usr/local/lib -L/home/dons/lib

$ echo $LD_LIBRARY_PATH 
/home/dons/lib

to help the linker out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM