环境准备
环境配置
Tools - Build System - New Build System
添加以下代码:
1 2 3 4 5 6
| { "cmd" : ["/usr/bin/g++ $file_name -std=c++11 -o ${file_base_name} && ./${file_base_name}"], "selector" : "source.c, source.c++", "shell": true, "working_dir" : "$file_path" }
|
1 2 3 4 5 6 7 8 9 10 11 12 13
| { "cmd": ["bash", "-c", "g++ '${file}' -std=c++11 -stdlib=libc++ -o '${file_path}/${file_base_name}'"], "file_regex": "^(..{FNXX==XXFN}*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "cmd": ["bash", "-c", "g++ '${file}' -std=c++11 -stdlib=libc++ -o '${file_path}/${file_base_name}' && open -a Terminal.app '${file_path}/${file_base_name}'"] } ] }
|