By exactly following this post, I was able to install gcc 3.4 on a fresh install of Ubuntu 14.04. But, when I try to compile a program, it fails with the following error:
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
I've looked at this answer and installed build-essential
but that did not resolve the issue. I still get the same error.
Also, I installed the dependencies for g++-3.4 before installing it:
sudo apt-get build-dep g++-3.4
UPDATE:
Trying gcc-3.4 -B/usr/lib/x86_64-linux-gnu hello.c
removes the first two errors.
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
UPDATE 2:
I read this post and tried it out on my system like below but it did not help:
gcc-3.4 -B /usr/lib/x86_64-linux-gnu -L /usr/lib/gcc/x86_64-linux-gnu/3.4.6/ hello.c