zoukankan      html  css  js  c++  java
  • Windows环境下在sublime text3配置C编译环境

    1. 检查本机有没有安装GCC,没有的话先进行安装

    2. 选择 sublime 的Tools->Build System->New Build System,建立配置文件,文件命名为C.sublime-build,文件内容如下:

    {
    "cmd": ["gcc","-Wall", "${file}", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",
    "encoding":"utf8",
    "variants":
    [
    {
    "name": "Run",
    "cmd": ["cmd", "/c", "gcc", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]
    },
    {
    "name": "RunInCommand",
    "cmd": ["cmd", "/c", "gcc", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & echo.&pause"]
    },
    {
    "name": "RunInShell",
    "shell_cmd": " start cmd /c ""${file_path}/${file_base_name}"&pause" "
    }
    ]
    }

    3. 写好C程序后,快捷键ctrl+b就可以执行该程序。

  • 相关阅读:
    每天进步一小点
    C# 类
    XML JavaScript
    基础XML
    多态,重载,重写
    数据结构
    sql server规范
    .net core 使用TimeZoneInfo类的时间与时间戳转换
    git 重命名文件与文件夹
    IDEA spring boot 开启热加载
  • 原文地址:https://www.cnblogs.com/miaoying/p/10691137.html
Copyright © 2011-2022 走看看