- 1.下载并安装tdm64-gcc-5.1.0-2,保持默认路径不便,其他next即可。
- 2.在ST3的Build system中增加C++编译的配置文件,名称类似C++Complier.sublime-build,前缀可自行命名,
- 3.配置内容如下,注意
-fexec-charset=GBK
,终端窗口支持中文:
{
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file_name\" -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++,source.c",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""
}
]
}
- 4.最后ctrl+shift+B即可选择编译或者编译并运行