sublime--sublimeclan安装记(windows)

本文详细介绍了如何在Windows 7系统上安装并配置Clang编译器及Sublime Clang插件的过程。首先,指导用户完成Clang的安装,并设置环境变量;接着,介绍如何安装Sublime Clang插件;最后,提供了具体的配置示例,包括去除不适用的选项、开启调试输出以及添加Windows系统的头文件路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

凌乱的一些小心得。

第一步在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"
        ]
    }
}
 

转载于:https://www.cnblogs.com/aoaoblogs/archive/2012/09/07/2676125.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值