ubuntu gcc version code example

Example 1: install gcc in ubuntu

$ sudo apt install build-essential

Example 2: check gcc version in ubuntu

Option 1. Issue command “gcc –version” Example : ...
Option 2. Issue command “gcc -v” ...

Example 3: 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