确认gcc已经安装
在
Packages/User
目录下新建文件cpp.sublime-build
{
"cmd" : ["gcc ${file} -o ${file_path}/${file_base_name}; ${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true
}