If you're doing C++ development for Linux, we recommend installing the GCC compiler. Installing GCC is simple, just follow these three steps:
Run the following command from the terminal window to update the Ubuntu package lists. An out-of-date Linux distribution can sometimes interfere with attempts to install new packages.
sudo apt update
Install the GNU compiler tools and the GDB debugger with this command:
sudo apt install build-essential gdb
Verify GCC is installed by running the following command. You should see a copyright message and information about the version of GCC you're using.
gcc --version