Compile C in Sublime Text

4

I'm using Windows , and I need to know how to compile programs written in C in this editor. No ubuntu is easier, but in Windows 8.1 I do not know how to do it. I am using Sublime Text 2 because it is my preferred editor.

    
asked by anonymous 03.06.2015 / 19:24

3 answers

10

Download the MinGW ( GCC ported to Windows ) on this site , install it and add the system variables.

Click Tools > Build System > New Build System , in the window that opens put the code below:

{
    "cmd" : ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe"],
    "selector" : "source.c",
    "shell" : true,
    "working_dir" : "$file_path"
}

Save as C.sublime-build .

Switch BuildSytem to C: Tools > BuildSystem > C.

Type a code in C and compile by pressing ctrl + b or on the Tools > Build .

Result:

Source: How do I compile and run a C program in Sublime Text 2?

    
03.06.2015 / 19:43
0

The sublime textbox is just a text editor with advanced features. What it does is just give a highlight in keywords, complete certain terms, etc.

An IDE primarily for static typing languages consists of two elements the advanced text manipulation features and the compiler, which is responsible for parsing the source code, checking for errors, and finally generating the artifacts. / p>

CodeBlocks

DevC ++

    
03.06.2015 / 19:38
0

If you have MinGW installed, just press Ctrl + B .

    
03.06.2015 / 19:42