How to get SublimeClang, https://github.com/quarnster/SublimeClang, going on OS X
First step clone SublimeClang repo into your Sublime package directory.
# git clone https://github.com/quarnster/SublimeClang.git
# cd SublimeClang
# git pull && git submodule foreach --recursive git pull origin master
Next step is to compile libcache.dylib from SublimeClang/src. There is a cmake project for doing this but I never got it to work and as it seems to be only one file, it is farly easy to figure this out. And don't get fooled this is not the same as the libcache.dylib that is available in the system.
# cd src
# clang++ -dynamiclib -I. -DSUBLIMECLANG_VERSION=\"1.0.41\" -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/ -lclang -std=c++11 main.cpp -o libcache.dylib
# cp libcache.dylib ..
Next is to fixup the SublimeClang config. The default is for an ancient version of toolchain so it needs to be changed. If you are on a different version then I am, you get all the paths by compiling a file with -v like clang++ -v yourfile.cpp.
diff --git a/SublimeClang.sublime-settings b/SublimeClang.sublime-settings
index 1b510f3..26c71db 100644
--- a/SublimeClang.sublime-settings
+++ b/SublimeClang.sublime-settings
@@ -148,3 +148,3 @@
// For example, you can use "c++": ["-std=c++11"] to enable C++11 features.
- "c++" : [],
+ "c++" : ["-std=c++11"],
"c": [],
@@ -272,5 +272,8 @@
[
- "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/",
- "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1",
- "-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/",
+ "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk",
+ "-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1",
+ "-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include",
+ "-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
+ "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include",
+ "-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/",
"-Wno-deprecated-declarations",
@@ -304,3 +307,3 @@
// included headers
- "dont_prepend_clang_includes": false,
+ "dont_prepend_clang_includes": true,
I can't seem to get it working with Sublime Text 3.
I was able to successfully build libcache.dylib and copied it into ...Packages/SublimeClang/
I also took libclang.dylib from the SublimeClang-1.0.41 package I downloaded from the SublimeClang github repo and placed it in the same directory with libcache.dylib.
However, I still can't get SublimeClang to work; none of the hot-keys do anything.
Did place libcache and libclang in the correct directory? Some other guides suggests placing them in the internals directory, even though that did not work for me.
Should I get libclang.dylib from somewhere else?
What else could I be missing?
Thanks for your help!