Contents
How do I change my default gcc?
Direct link to this answer
- Open the terminal window in LINUX and execute the command:
- $ which gcc.
- This will provide the symbolic link (softlink) to the default version of GCC.
- Navigate to the directory which has this softlink.
- Change the softlink to point to the version of GCC that you want to use.
How do I change the default gcc compiler in Ubuntu?
Type update-alternatives –config gcc to be asked to choose the gcc version you want to use among those installed.
How do I change the default gcc compiler in Centos?
Here is the recipe:
- check your if you shell is bash, if not set it to bash: $ echo $SHELL. /bin/tcsh.
- Switch to bash: $ bash.
- Add new version of GCC to the front of the PATH:
- Check the PATH: bash-4.1$ echo $PATH.
- Check version of GCC used (It picks up the first GCC from the PATH): bash-4.1$ gcc –version.
What is the latest version of gcc?
With roughly 15 million lines of code in 2019, GCC is one of the biggest free programs in existence….GNU Compiler Collection.
| Screenshot of GCC 10.2 compiling its own source code | |
|---|---|
| Initial release | May 23, 1987 |
| Stable release | 11.2 / July 27, 2021 |
| Preview release | 11.2.0-RC / July 21, 2021 |
| Repository | gcc.gnu.org/git/ |
How to switch to default gcc after switched to a?
I want to install several gcc with different versions in centos. The default version of gcc in centos 6 is 4.9.3. So I use devtoolset install a higher version of gcc. Then I switch to the higher version of gcc by executing “source /opt/rh/devtoolset-5/enable”.
How to change the default gcc compiler in Ubuntu?
With that, llvm-config (version 3.7) appears with its plain name in your PATH. No need to muck around with symlinks, nor to call the llvm-config-3.7 that got installed in /usr/bin. Also, check for a package named llvm-defaults (or gcc-defaults), which might offer other way to do this (I didn’t use it).
How to install as many versions of GCC as you need?
You can install as many versions of gcc either by installing devtoolset-# via yum or by compiling then from source. The first way is the easiest. Make sure that you are installing the devtoolset packages via the scl repo.
Can You Change GCC version with CPP bin?
NOTE: g++ version is changed automatically with a gcc version switch. cpp-bin has to be done separately as there exists a “cpp” master alternative. I found this problem while trying to install a new clang compiler.