Sublime Forum

Regular (and basic) C Build System for ST 3 (mac)

#1

Hi everybody,

NB - I don’t use regular C for a while…

Sorry for a very simple question. Buy default with ST 3 (mac version) I have a C++ Build System but no classic C Build System. Can you tell me:
– how to make this manually ;
OR
– what package to install using Package Controls. For the moment I don’t need an advanced package, just a “Compile && Run” Build System.

I’m really surprised that this is not available by default. Or maybe I’m missing something here…

Thanks,


Pierre

0 Likes

#2

Sublime Text 3 has a default build system in the C++ package called C++ Single File that contains a variant named Run that will first compile your program and then run it for you if the compilation is successful. Despite the name, it works for C programs as well (that’s probably what is throwing you off here).

You can manually select it from the Tools > Build System menu, or select Automatic from that menu and it will be selected for you whenever you’re working with a C/C++ file.

As the name suggests, it will only work for you if you’re working on a program wholly contained in a single source file. If you’re working on something more complicated than that you will need something else. In such a case it’s better to use a dedicated external build system (e.g. make) and then interface to it from within Sublime (which also supports make by default as well).

0 Likes