Advertisement
arfin97

Ubuntu - Sublime Text C++ run

May 16th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Sublime text is a lightweight text editor. Sometimes people prefer it over Ide like codeblocks. But, in order to compile and run C/C++ program one need to make their build system manually. 1) To istall sublime text 3: sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt-get install sublime-text-installer 2) To install g++ : sudo apt-get install g++ to install g++ 3) to make new build system { "cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++, source.cxx, source.cpp", "variants": [ { "name": "Run", "shell": true, "cmd": ["gnome-terminal -e 'bash -c \"${file_path}/${file_base_name};echo;echo; echo Press ENTER to continue; read line;exit; exec bash\"'"] } ] } [ To compile program press Ctrl+shift+b and select c++ ] [To run program press Ctrl+shift+b and select c++ run ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement