...

/

Install Some Basic Tool

Install Some Basic Tool

Compile and run C code on your personal computer based on your operating system.

No matter which operating system you are using (GNU/Linux, Mac, Windows), you will need at least two things:

  1. A way to edit source code files
  2. A C compiler (& debugger)

GNU/Linux

You have it easy! Most GNU/Linux distributions include a package manager that allows you to quickly and easily install software from centralized, up-to-date repositories.

Compiler

If you are using Ubuntu, just open up a terminal and type the following command to install the tools you need:

sudo apt-get install build-essential

That’s it! Now you have a C compiler (gcc) and a bunch of other developer tools including a debugger (gdb). You can verify you have gcc installed by typing:

gcc --version

Code editors

When you write C source code, you save it in one or more plain (ASCII) text files. Any editor that is capable of reading and writing plain text files, can be used to work with C code.

For example, Ubuntu comes with a relatively nice ...