Page 1 of 1

Question about GCC.

Posted: Wed Mar 08, 2006 7:02 pm
by donatello
Can I install another version of GCC (I want to use the judge's version 2.95) but I want to keep the newer version as well for other contests) in parallel and use both together (with say different commands)?

Posted: Thu Mar 09, 2006 3:48 am
by misof
Yes. In fact, under most linux distributions this is a common thing, and it is directly supported by the packaging system. You will have several binaries called gcc-version, and a symbolic link gcc pointing to one of them, the default one.

Code: Select all

[misof@element]:~$ ls -al /usr/bin/gcc /usr/bin/gcc-*
lrwxrwxrwx  1 root root     7 Dec 27 20:00 /usr/bin/gcc -> gcc-4.0
-rwxr-xr-x  1 root root 69960 Mar 10  2004 /usr/bin/gcc-2.95
-rwxr-xr-x  1 root root 74056 Apr  8  2002 /usr/bin/gcc-3.0
-rwxr-xr-x  1 root root 81648 Sep 16 13:59 /usr/bin/gcc-3.3
-rwxr-xr-x  1 root root 88848 Jan 22 19:36 /usr/bin/gcc-3.4
-rwxr-xr-x  1 root root 93008 Jan 29 04:52 /usr/bin/gcc-4.0