2011-11-08

Multiple gcc versions on Ubuntu machine

# let the beast in
su

# install the older gcc versions
apt-get install gcc-4.4
apt-get install g++-4.4

# configure
update-alternatives --remove-all gcc
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44
 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.4
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 46
 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.6

# switch gcc
update-alternatives --config gcc

No comments:

Post a Comment