As @Tommy suggested, you should use update-alternatives
.
It assigns values to every software of a family, so that it defines the order in which the applications will be called.
It is used to maintain different versions of the same software on a system. In your case, you will be able to use several declinations of gcc
, and one will be favoured.
To figure out the current priorities of gcc, type in the command pointed out by @tripleee's comment:
update-alternatives --query gcc
Now, note the priority attributed to gcc-4.4
because you'll need to give a higher one to gcc-3.3
.
To set your alternatives, you should have something like this (assuming your gcc
installation is located at /usr/bin/gcc-3.3
, and gcc-4.4
's priority is less than 50):
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.3 50
--edit--
Finally, you can also use the interactive interface of update-alternatives
to easily switch between versions. Type update-alternatives --config gcc
to be asked to choose the gcc version you want to use among those installed.
--edit 2 --
Now, to fix the CXX environment variable systemwide, you need to put the line indicated by @DipSwitch's in your .bashrc
file (this will apply the change only for your user, which is safer in my opinion):
echo 'export CXX=/usr/bin/gcc-3.3' >> ~/.bashrc
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…