新建C++语言编译系统
选择tool –> Build System –> New Build System(中文是:工具–> 编译系统 –> 新编译系统 )
删除其中内容填写下面代码
{
// "shell_cmd": "make"
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "g++ -Wall -std=c++0x \"$file_name\" -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.cpp",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -Wall -std=c++0x \"$file\" -o \"$file_base_name\" && \"${file_path}/${file_base_name}\""
}
]
}
点击Ctrl+S保存为c++.sublime-bulid文件。
关闭你的Sublime Text。
重新启动。
Ctrl+B.出现下图

OK!!!
本文详细介绍如何在Sublime Text中配置C++语言的编译系统,包括设置编译命令、工作目录、正则表达式匹配及运行命令,帮助用户快速实现C++代码的编译与运行。
4123

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



