Re: changing default version of g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/02/13 16:37, Mahmood Naderan wrote:
> 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
You have another g++ at /usr/local/bin/g++

And your PATH gives more priority to /usr/local/bin than /usr/bin


> 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?
Yes, it is safe. Although you would have to decide what to do with the
g++ binary you already have there.
According to FHS, /usr/local is for use by the system administrator so
you can change it at will, the system updater won't overwrite it.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux