网上看了太多了版本,没一个是正确的,我的意思是没一个实在ubuntu下的版本
cmd的命令windows mac linux 都是不一样的所以我参考mac下的版本写个一个ubuntu的
tools->build system->New build system:清空原来的内容,输入下面:
{
"cmd" : ["gnome-terminal -x bash -c \"g++ $file_name -o ${file_base_name} -lm -Wall; ./${file_base_name}; exec bash\""],
"selector" : "source.c, source.c++",
"shell":true,
"working_dir" : "$file_path"
}
保存个g++.sublime-build
然后build with 选这个就好了
ctrl + b 直接运行