gcc install ubuntu code example
Example 1: install gcc in ubuntu
$ sudo apt install build-essential
Example 2: Compiling GCC 10 on ubuntu
1 cd ~
2 mkdir build && cd build
3 ../gcc-10.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-10.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-10.1
Example 3: gcc 7 install ubuntu
sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9