Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you compile a c program in atom editor

Tags:

c

gcc

atom-editor

I downloaded atom a couple of days ago and I can't seem to find the right package or where and how you compile the program. does anyone know?

like image 942
Will Shepard Avatar asked Jul 19 '16 15:07

Will Shepard


2 Answers

Now, it's possible to run and compile (also debug) C and C++ program from within atom editor. Install gpp compiler package in atom editor.


Prerequisites:
Windows:
You'll need to install MinGW and add it to your system PATH.

Mac:
You'll need to install XCode.

Linux:
The GNU Compiler Collection may come with your distribution. Run which gcc g++ to find out.


To compile and run: F5

To debug: F6

like image 117
GorvGoyl Avatar answered Oct 17 '22 15:10

GorvGoyl


Atom is "simply" a Text editor that is not able to compile anything. If you use a Makefile, then there are a few add-ons for building targets via key bindings.

If not, open a terminal and use the C compiler on your system. On Linux/Unix machines you probably want to use gcc:

gcc <your_source>.c -o <output_name>

EDIT

Or take a look at This Package

like image 3
mame98 Avatar answered Oct 17 '22 13:10

mame98