所需安装包
Sublime Text3
Codeblocks(mingw-setup)
安装与配置
分别安装 Sublime Text 和 Codeblocks,并且把 Codeblocks 安装目录下 MinGW 文件夹目录添加到环境变量中。
配置 Codeblocks:Setting –> Compiler,在“Have g++ follow the C++14 ISO C++ language standard [-std=c++14]” 选项上打勾、保存。
配置 Sublime Text:Tools –> Build System –> New Build System
粘贴下面的代码(注意 CodeBlocks 的目录):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| { "cmd": ["g++", "-std=c++14","${file}", "-o", "${file_path}/${file_base_name}.exe"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c++", "encoding": "cp936", "shell": true, "variants": [ { "name": "Run", "cmd": ["start","~/CodeBlocks/cb_console_runner.exe","${file_path}/${file_base_name}"] } ] }
|
保存为 C++.sublime-build.