clang_complete: where is the libclang.{so,dylib} in OS X?
Solution 1
On macOS Catalina(newest, while posting) you can find it in the Xcode application, here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib
As well as outside of it if you just use Command Line Tools and you don't have Xcode.app installed, here:
/Library/Developer/CommandLineTools/usr/lib/libclang.dylib
Solution 2
With the latest (appstore) XCode 4.3.2, the location changed, it can now be found in
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib
The /Developer
directory, among others, no longer exists by default. Everything is now packaged inside the XCode application, so that delta updates from the appstore work.
Solution 3
You can always do a search of your filesystem. There are several ways.
On a Mac with Spotlight this is probably the best:
mdfind -name libclang.dylib
However most UNIX systems also have a locate database, which can be searched easily:
locate libclang.dylib
And when all else fails you can iterate through the file system (rather slowly) using find:
find / -type f -name libclang.dylib -o -name libclang.so
You'll get some errors about unreadable locations because they're only readable by root, but that's fine (hide these errors with 2> /dev/null
).
Solution 4
I found the answer:
In OS X, with XCode 4 installed, libclang.dylib is at /Developer/usr/clang-ide/lib/libclang.dylib
This is just posted for those who are interested in the answer.
Related videos on Youtube
Comments
-
Andrew Spott over 3 years
I looked in the usual places (/usr/lib/,/Developer/usr/lib/,/usr/local/lib), and it isn't there.
If it isn't installed, does anyone know where I can find instructions to install it?
Thanks!
I'm not sure if I should close this, but I found the answer I was looking for:
In OS X, with XCode 4 installed, libclang.dylib is at /Developer/usr/clang-ide/lib/libclang.dylib
-
GWW about 13 yearsOne small tip, I recommend that you install the latest version of clang (if you haven't already) the one bundled with OSX is quite outdated.
-
Andrew Spott about 13 years@GWW: Do you know any good tutorials for doing so? the LLVM and CLANG websites are geared toward compiling and installing the debug version of clang, not a release version, and I don't know the configure flag to change that.
-
osgx about 13 yearsAdd an
'--enable-optimized'
option to./configure
script of llvm -
haggai_e about 13 yearsI think it is common in this case to answer the question yourself, and then accept it.
-
-
Krumelur almost 13 yearsOr "mdfind -name libclang.dylib", which is a ton quicker :)
-
Kris Jenkins over 12 yearsOr
locate libclang.dylib
, for a third option. -
Daco Harkes about 2 yearsPlease note that the Command Line Tools has the Objective C headers pre-included, but the Xcode one doesn't. (If one was interested in parsing ObjectiveC as well.) github.com/dart-lang/ffigen/pull/402#issuecomment-1154348670