Golevka / emacs-clang-complete-async

An emacs plugin to complete C and C++ code using libclang
360 stars 71 forks source link

Auto-completion is not working #63

Open studentz opened 10 years ago

studentz commented 10 years ago

The auto-completion is not working. clang-complete compile without problem, but the error is generated using auto-completion in Emacs My system: Ubuntu: 13.1 clang 3.4 llvm 3.4 emacs 24.3.1 This is the error captured in the clang buffer: error while loading shared libraries: libclang.so: cannot open shared object file: No such file or directory.. Thanks

seriyps commented 10 years ago

Have the same issue. Ubuntu 13.10

$ ~/.emacs.d/emacs-clang-complete-async/clang-complete
/home/seriy/.emacs.d/emacs-clang-complete-async/clang-complete: error while loading shared libraries: libclang.so.1: cannot open shared object file: No such file or directory

I have installed libclang-devand libclang1 packages.

$ locate libclang.so
/usr/lib/llvm-3.2/lib/libclang.so
/usr/lib/llvm-3.2/lib/libclang.so.1
$ llvm-config --ldflags
-L/usr/lib/llvm-3.2/lib  -lpthread -lffi -ldl -lm

but

$ sudo /sbin/ldconfig -p | grep clang

produces no output

seriyps commented 10 years ago

Looks like following hack may help:

  1. Create file /etc/ld.so.conf.d/llvm.conf with the following content /usr/lib/llvm-3.2/lib.
  2. Run command sudo /sbin/ldconfig
studentz commented 10 years ago

That is is the right way to go. Other option that worked for me was expanding LD_LIBRARY_PATH Add this line to your .emacs file. (setenv "LD_LIBRARY_PATH" (expand-file-name "/usr/lib/llvm-3.4/lib/" "/"))