mac 环境下sublime text2安装sublimeClang (c/c++)
·
参考:
1)http://fduo.org/use-sublimeclang-for-objc-dev/ (使用SublimeClang在Sublime Text 2中进行Objective-C开发)
2)https://github.com/quarnster/SublimeClang (官网)
安装环境 MAc
首先可以根据官网的步骤安装,但是要说明下官网已经说了“Plugin discontinued” ,就是已经不再更新了,新的维护在https://github.com/quarnster/completion, 看了下是用go语言的编的,现在(20130611)还是可以使用的。
注意:下面的install package方式我这边安装失败,(其实就是立马提示安装成功,其实package 根本没有sublimeClang的目录);可以使用手动安装方式;
Installation
- The easiest way to install SublimeClang is via the excellent Package Control Plugin. Note that SublimeClang doesn't install correctly with version v1.6.3 of Package Control; either use the latest testing version or (if it exists) a newer stable version of Package Control.
- See http://wbond.net/sublime_packages/package_control#Installation
- Once package control has been installed, bring up the command palette (cmd+shift+P or ctrl+shift+P)
- Type Install and select "Package Control: Install Package"
- Select SublimeClang from the list. Package Control will keep it automatically updated for you
- If you don't want to use package control, you can manually install it
- Go to your packages directory and type:
- git clone --recursive https://github.com/quarnster/SublimeClang SublimeClang
- After this you'll have to Compile libcache as described in the Additional Prerequisites (Linux Only) section
- To update run the following command:
- git pull && git submodule foreach --recursive git pull origin master
- Go to your packages directory and type:
- See http://wbond.net/sublime_packages/package_control#Installation
- Back in the editor, open up the command palette by pressing cmd+shift+P or ctrl+shift+P
- Type SublimeClang and open up the settings file you want to modify with any include directories or other options you want to provide to clang.
上面说的“After this you'll have to Compile libcache as described in the Additional Prerequisites (Linux Only) section”,你可以按照下面的步骤安装,见下;
cd src
mkdir build
cd build
cmake ..
(如果没有安装cmake ,可以sudo brew install cmake 安装)
make
安装最后一个步骤
编辑打开Command Plaette,找到Preferences: SublimeClang Settings - User
{
"options":
[
"-Wall",
"-I/usr/lib/clang/4.2/include/**",
"-I/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/"
]
}
好了,可以使用了;
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)