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就可以执行该程序。

相关文章:

  • 2020-06-09
  • 2021-04-08
  • 2022-12-23
  • 2021-11-19
  • 2021-11-14
  • 2021-11-28
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2021-12-18
  • 2022-02-24
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2019-11-09
  • 2021-11-06
相关资源
相似解决方案