选择tools->build system->new build system.
新打开的文件下添加如下代码,并保存为c.sublime-build.
-
"cmd": ["gcc", "${file}", "-o", "${file_path}/${file_base_name}"],
-
"file_regex": "^(..[^:]*):([0-9] ):?([0-9] )?:? (.*)$",
-
"working_dir": "${file_path}",
-
"selector": "source.c",
-
-
"variants":
-
[
-
{
-
"name": "run",
-
"cmd": ["bash", "-c", "gcc '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
-
}
-
]
-
在编写程序时记得选择c语言选项如图
-
阅读(4033) | 评论(0) | 转发(0) |