sublime--sublimeclan安装记(windows)

凌乱的一些小心得。

第一步在win7上安装clang,参考 http://clang.llvm.org/get_started.html 上的步骤,很繁琐的。。安装完了,要在path里面设置clang.exe的目录,最好把VS的link.exe拷贝到同一个目录下,因为clang编译出来时不带linker的。
 
第二步,安装sublimeclang,按照 https://github.com/quarnster/SublimeClang的步骤安装。
 
第三步,配置sublimeclang. 这里有几个问题:
在SublimeClang/SublimeClang.sublime-settings里,clang的option有一些linux的东西,要把他们去掉,
     // Set "debug_options" (defined below) to true to print the final options used for compilation to the python console
     "options":
     [
-        "-Wall",
-        "-I/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/",
-        "-I/usr/lib/gcc/i686-apple-darwin11/4.2.1/include/",
+        "-Wall"
+        //"-I/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/",
+        //"-I/usr/lib/gcc/i686-apple-darwin11/4.2.1/include/",
         // If you code for iOS, you want to have something like the following here:
         //"-isysroot",
         //"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk",
         //"-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300",
-        "-IC:/MinGW/include",
-        "-I/path/to/sources/1",
-        "-I/path/to/sources/2"
+        //"-IC:/MinGW/include",
+        //"-I/path/to/sources/1",
+        //"-I/path/to/sources/2"
     ],
 
还有可以打开debug_options
     // When set to true will output the final options used to the python console
-    "debug_options": false,
+    "debug_options": true,
 
然后可以加上一些Windows include 目录在sublime-settings,这样就是全局了。
也可以在project settings里面加,比如这样
{
     "folders":
     [
          {
               "path": "/C/EverBox/gitCode/clangxx"
          }
     ],
    "settings": {
        "sublimeclang_options": [
            "-Wall",
            "-IC:\\EverBox\\gitCode\\clangxx\\inc"
        ]
    }
}
 
posted @ 2012-09-07 23:28  嗷嗷  阅读(3281)  评论(1编辑  收藏  举报