第一步:下载mingw绿色免安装版Here
第二步:sublime text 3免安装版下载、如果看不懂英文网上有汉化包下载
第三步:将下载好的mingw免安装版拷贝到sublime根目录下
第四步:打开sublime-tools/工具-build system/编译系统-new build system/新编译系统,设置编译系统的配置文件,并保存文件名C++.sublime-build
{
"path": "G:/Sublime Text 3_x64(Python and CPP)/MinGW/bin",
"cmd": ["g++.exe", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"encoding":"UTF-8",
"encoding": "cp936",
"variants":
[
{
"name": "Run",
"cmd": [ "${file_path}/${file_base_name}.exe"],
"shell": true,
"cmd" : ["start", "cmd", "/k", "${file_path}/${file_base_name} &&echo. & pause && exit"]
}
]
}
将path参数设置为sublime目录下mingw文件夹的bin目录
Ctrl + B 编译
Ctrl + Shift +B 运行