- Tools → Build System → New build system...
- Paste the content below
{
"cmd": ["g++ ${file} -o ${file_path}/${file_base_name} && echo 'Build Finished' && ${file_path}/${file_base_name}"],
"shell" : true
}
- Save as
C++ Build and Run.sublime-build
- Open a C++ file
- Select Tools → Build System → C++ Build and Run
- cmd + b
It doesn't work for some reason. After I use cin, the program just enter a constant waiting-for-input state. Do you know how to fix this?