LoginSignup
5
5

More than 5 years have passed since last update.

clang_completeがライブラリのロードに失敗したとき@mac

Last updated at Posted at 2014-06-02

clang-3.5 via macports

g:clang_library_pathを正しく設定してもロードに失敗する。以下のような感じのエラーがでる。

Referenced from: /opt/local/libexec/llvm-3.5/lib/libclang.dylib
Reason: image not found

dylibの依存関係が解決できないらしい。パスが@executable_path(なんそれ?)からの相対パス。
https://github.com/Rip-Rip/clang_complete/issues/39

install_name_toolを使うと上を変更できる。
http://mactkg.hateblo.jp/entry/2012/05/03/202549

$ sudo install_name_tool -change '@executable_path/../lib/libLLVM-3.5.dylib' /opt/local/libexec/llvm-3.5/lib/libLLVM-3.5svn.dylib   /opt/local/libexec/llvm-3.5/lib/libclang.dylib

エラーメッセージ消える。補完もできる。

てかMacめんどい。

少し経ったら似たようなロードエラーが起きたので以下も実行。

$ sudo install_name_tool -change '@rpath/libLLVM-3.5.0svn.dylib' /opt/local/libexec/llvm-3.5/lib/libLLVM-3.5.0svn.dylib  /opt/local/libexec/llvm-3.5/lib/libclang.dylib
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5