Skip to content

Set up a development environment for C++ on Ubuntu

C++ is a compiled language. The GNU Compiler Collection (GCC) is a set of compilers for programming languages, including C, C++, Assembly, and many more. It is the de facto standard in Linux environments and is used to compile both the GNU toolchain and the Linux kernel.

1. Installing GCC compilers for C and C++:

sudo apt install gcc g++
If you want a specific version of g++, you may install it by
sudo apt install g++-<version>
for example
sudo apt install g++-13
An alternative, but common approach is to install the build-essential package, which is a collection of common tools including gcc, g++, and make.

2. Installing debuggers (gdb)

The standard debugger developed for GCC is the GNU Debugger (GDB). To install it,

sudo apt install gdb

3. Installing build tools (make, backend for cmake)

sudo apt install make

4. Installing build systems (cmake)

Setting up cmake APT repository from kitware: https://apt.kitware.com/

sudo apt-get install cmake