试了这么多,这个终于跑通了,艰辛呀。要把这个在sublime里的c编译的配置记下来。
{ "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":"cp936", "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"] } ]}
{ "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":"cp936", "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"] } ]}

本文分享了一种在Sublime Text中配置C语言编译的方法。通过详细的配置信息,可以实现在Sublime Text中直接编译并运行C程序的功能。配置包括编译命令、正则表达式匹配、工作目录等。
1471

被折叠的 条评论
为什么被折叠?



