Sublime Text 3 is an excellent code-editing software. The interface is simple, lightweight and fast, very popular with everyone.
Recently began to use him to edit the data structure of the code, which requires a new compilation system. Here's how:
First of all:
Next is the key step, paste the following code into the pop-up edit page, the file name is name.sublime-build form, name is the new compiler name.
1 {2 "cmd": ["GCC","${file}","-FEXEC-CHARSET=GBK","- o","${file_path}/${file_base_name}"],3 "File_regex":"^(.. [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",4 "Working_dir":"${file_path}",5 "selector":"source.c",6 7 "variants":8 [9 {Ten "name":"Run", One "cmd": ["cmd","/ C","-FEXEC-CHARSET=GBK","GCC","${file}","- o","${file_path}/${file_base_name}","&&","cmd","/ C","${file_path}/${file_base_name}"] A }, - { - "name":"Runincommand", the "cmd": ["cmd","/ C","GCC","${file}","-FEXEC-CHARSET=GBK","- o","${file_path}/${file_base_name}","&&","Start","cmd","/ C","${file_path}/${file_base_name} & Pause"] - } - ] -}
More to say, there are many compiler code on the Internet, some may be because the version of the reason can not compile successfully, some run will be encoded resulting in garbled appearance. The code I posted above is tested to be perfectly compiled and run, and can be used with confidence.
Sublime Text 3 to compile and run C language code