Installing the C compiler for Ubuntu

Time:2021-9-11

environment

  • Linux/Ubuntu20.04LTS
  • gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

technological process

  1. Open the terminal to check whether there is a compiler for C in this machine
[email protected]:~$ gcc -v

Command 'gcc' not found, but can be installed with:

sudo apt install gcc
  1. If the prompt is not installed, follow the prompt to install
[email protected]:~$ sudo apt install gcc
  1. When the installation is complete, view the installed version
[email protected]:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) 

The installation is complete!

[in rainy season, eat rainbow] – layuji