Compiling C + +:
Select Tools-Build System-New build system, copy the code below, save it, and name it yourself.
Then open the C + + file, select Tools---builid System--you just saved the name, press CTRL + B to compile.
{
"cmd": ["g++", "-wall", "-std=c++11", "${file}", "-O", "${file_path}/${file_base_name}"],//For GCC on Windows and Linux
"cmd": ["CL", "/fo${file_base_name}", "/o2", "${file}"],//For CL on Windows only
"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",
"Working_dir": "${file_path}",
"Selector": "Source.c, source.c++",
"Variants":
[
{
"Name": "Run",
"cmd": ["Bash", "-C", "g++ ' ${file} '-O ' ${file_path}/${file_base_name} ' && ' ${file_path}/${file_base_name} '"] Linux only
"cmd": ["cmd", "/U", "/C", "g++-std=c++11 ${file}-o ${file_base_name} && ${file_base_name}"]//For GCC on Wi Ndows only
"cmd": ["cmd", "/U", "/C", "Cl/fo${file_base_name}/o2 ${file} && ${file_base_name}"]//For CL on Windows on Ly
}
]
}
Compiling Pascal:
{
"cmd": ["FPC", "-WV", "-G", "${file}", "${file_path}/${file_base_name}"],//For GCC on Windows and Linux
"cmd": ["CL", "/fo${file_base_name}", "/o2", "${file}"],//For CL on Windows only
"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",
"Working_dir": "${file_path}",
"Selector": "Source.pascal",
"Variants":
[
{
"Name": "Run",
"cmd": ["Bash", "-C", "FPC ' ${file} ' ' ${file_path}/${file_base_name} ' && ' ${file_path}/${file_base_name} '"]// Linux only
"cmd": ["cmd", "/U", "/C", "g++-std=c++11 ${file}-o ${file_base_name} && ${file_base_name}"]//For GCC on Wi Ndows only
"cmd": ["cmd", "/U", "/C", "Cl/fo${file_base_name}/o2 ${file} && ${file_base_name}"]//For CL on Windows on Ly
}
]
}
Compile C + + and Pascal with sublime Text3 under Ubuntu