There are a number of different ways to set up a C development environment.
Most Un*x/Linux distributions come with a number of development and build tools, which you can selectively install. The core/essential build tools packages generally include C compilers such as gcc or clang.
For example, on Ubuntu,
sudo apt install build-essential
This will install gcc, among other tools.
$ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you prefer to use clang, you can additionally install it.
(You will always need the build-essential package
if you plan to do any low-level C development on Ubuntu.
For instance, the package includes the
which many developers use for their C program development.)
sudo apt clang
$ clang --version clang version 10.0.0-4ubuntu1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
Refer to other resources for installing C development tools on other Un*x/Linux like platforms, including Mac.
Now that we have a development environment set up, let's try creating a simple program.
- Next Step: Creating the first program in C