CentOS 8 / RHEL 8 install g++ compiler

CentOS 8 / RHEL 8 does not have a g++ compiler by default, but it usually comes with a gcc-8.3 compiler. For this we need to install g++ compiler

1. There is a problem

When your CentOS 8 / RHEL 8 has just been installed, this interface will appear when you check your g++ environment

# Detection version
g++ -v

2. Install g++ compilation environment

The above problem occurs because you have not installed the g++ environment. The solution is to install the g++ version corresponding to gcc with the following command

#  install g++  run with root privileges
yum install gcc-c++

3. Test

g++ -v

0

Leave a Reply

Your email address will not be published.