This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: changing default version of g++
- From: Chung-Ju Wu <jasonwucj at gmail dot com>
- To: Mahmood Naderan <nt_mahmood at yahoo dot com>
- Cc: gcc <gcc-help at gcc dot gnu dot org>
- Date: Thu, 7 Feb 2013 23:51:34 +0800
- Subject: Re: changing default version of g++
- References: <1360251460.41952.YahooMailNeo@web163004.mail.bf1.yahoo.com>
Hi Mahmood,
Maybe you should check your $PATH setting?
Best regards,
jasonwucj
2013/2/7 Mahmood Naderan <nt_mahmood@yahoo.com>:
> Hi
> These are the installed gcc/g++ on my system
>
>
> $ ls -l /usr/bin/g++*
> lrwxrwxrwx 1 root root 7 Mar 13 2012 /usr/bin/g++ -> g++-4.6
> -rwxr-xr-x 1 root root 94808 Mar 16 2006 /usr/bin/g++-3.4
> lrwxrwxrwx 1 root root 52 Feb 6 23:32 /usr/bin/g++-4.1 -> /opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/g++
> -rwxr-xr-x 1 root root 263328 Apr 16 2012 /usr/bin/g++-4.4
> -rwxr-xr-x 1 root root 357312 Apr 16 2012 /usr/bin/g++-4.6
>
>
> The default g++ should point to g++-4.6, however:
>
> $ which g++
> /usr/local/bin/g++
>
>
> $ g++ -v
> Using built-in specs.
> Target: x86_64-unknown-linux-gnu
> Configured with: ./configure --disable-multilib
> Thread model: posix
> gcc version 4.1.2
>
>
> How can I change the default g++ to 4.6?
>
> Is it safe to create a symbolic link from /usr/local/bin/g++ to /usr/bin/g++ ?
> Or there may be some libc incompatibilities?
>
>
> Regards,
> Mahmood
>