Search code examples
c++gccrhel

My installed GCC version is behind my installed Redhat developer toolset version


I have been searching for the answer to this for a while. I'm on RHEL 6.x and I am trying to upgrade gcc in order to install a package. Also, I have a super old version of gcc and it's time to upgrade anyway.

(For now, let's assume that an OS upgrade is out of the question, so if this DOES require an OS upgrade, the package will have to wait.)

I found that the best way to upgrade gcc is by using Redhat Developer Toolset. I look into it, and find that I already have devtoolset-4 installed, which, to my understanding, installs gcc version 5.2.1 with it. Yet, for some reason, my current gcc version is 4.4.7.

Any idea why this would happen?


Solution

  • Did you run scl enable devtoolset-4 -- bash or something like that before checking the GCC version with gcc --version? The Developer Toolset compilers are not installed as the default system compilers, you need to enable this software collection first.

    The scl command starts a subshell with the environment variables set up so that the relevant directories are located at the start of the search paths (PATH in particular).