Ubuntu 14.04 comes with GCC v4.8. The last version of Ubuntu to include GCCv3.4 was Hardy. So we'll need to include that in our repo source list. The problem here was that all the posts I found referenced incorrect old-releases addresses, so here is what I found that worked...
Note, if you haven't done so already, be sure to install the build stuff:
apt-get install build-essentialFirst add the old repos to the sources file, so apt can find what we need:
vim /etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu hardy universe
deb-src http://old-releases.ubuntu.com/ubuntu hardy universeThen get the latest repo data:
apt-get updateThen install the older GCC:
apt-get install gcc-3.4
apt-get install g++-3.4Next, we'll need to configure multiple compilers (note, the last number is just an arbitrary priority):
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.4 10After that, just select which compiler you want to use, before you go to compile:
update-alternatives --config gccI also found that I had to update the linker's symbolic link, as it was pointing to a non-existent library file (/lib/libgcc_s.so.1):
ln -sfn /lib/x86_64-linux-gnu/libgcc_s.so.1 /usr/lib/gcc/x86_64-linux-gnu/3.4.6/libgcc_s.so
No comments:
Post a Comment