This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-4.6.0 breaks
On 2 June 2011 13:17, Bill Cunningham wrote:
>
> ? Ok but I have another question concerning gcc. I would like to have 2
> compilers. A default and one perhaps in /usr/local or another directory. How
> can I switch back and forth between which compiler I want?
The same way you'd choose between any two programs in different locations.
You could adjust your $PATH or write a script which calls the one you want.
I have a handful of versions installed in ~/gcc/ and invoke them via a
script like
#!/bin/bash
: ${ver:=4.7}
: ${libdir:=lib64}
$HOME/gcc/$ver/bin/g++ -Wl,-rpath,$HOME/gcc/$ver/$libdir -Wall -g "$@"