-   Linux - General (
-   -   install gcc 3.4 along side gcc 4 problem on ubuntu 11.10 (

lilmike 06-27-2012 08:54 PM

install gcc 3.4 along side gcc 4 problem on ubuntu 11.10
Hi all,
I have an ubuntu 11.10 server which I mainly use for text game development. I was considering using a text game codebase which is no longer supported but I have been told is easily maintainable. For that reason, I tried compiling it... but lots of errors occurred when doing so. I was told by the same people that it compiled fine under gcc 3.x, so I installed gcc 3.4 from the hardey repos. Now gcc is installed, but it can't create executibles because (so I've been told) binutils is not installed or something similar. I would just do apt-get install build-essential, but I already have that package with gcc 4, I need all the other things that work with gcc 3.4. So that leads me to my question: How to install binutils and other required software for gcc 3.4 along side all the required software for gcc 4?

knudfl 06-28-2012 04:39 AM

First : You can have as many versions of gcc as you want,
installed at the same time.

But : No old Ubuntu compilers will work in Ubuntu 11.04, 11.10 etc.
It's not about binutils or any other package :
The gcc binary is hard coded with certain search path's.
And the later Ubuntu's have got new hideaway locations for :, { crt1.o crti.o crtn.o },
"/usr/include/": asm/: bits/: gnu/: sys/ .

"gcc" has search path's for finding files in it's own directories.
The missing files can be copied or linked into "old gcc" :
Then the modifications will not alter your system files.
Example : A "gcc41-compat 11.04" modified for 11.10 ..

sudo cp -a /usr/include/i386-linux-gnu/asm/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/
sudo cp -a /usr/include/i386-linux-gnu/bits/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/
sudo cp -a /usr/include/i386-linux-gnu/gnu/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/
sudo cp -a /usr/include/i386-linux-gnu/sys/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/

## crt1.o  crti.o  crtn.o :
sudo cp /usr/lib/i386-linux-gnu/crt* /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/

## /usr/gcc41/lib/ :
sudo rm*
sudo cp /lib/i386-linux-gnu/ /usr/gcc41/lib/
## /usr/gcc41/lib/ :
sudo ln -s

Links :
gcc41-compat 11.10
gcc34-compat 11.04


All times are GMT -5. The time now is 01:22 PM.