LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   installing gcc 3.4 in ubuntu 8.4 (https://www.linuxquestions.org/questions/linux-software-2/installing-gcc-3-4-in-ubuntu-8-4-a-764285/)

charix 10-24-2009 10:33 PM

installing gcc 3.4 in ubuntu 8.4
 
hey guys am bit new to linux and am having a hard time installing gcc 3.4 instead of gcc 4.2.4. when i try install by

sudo apt-get install gcc 3.4 t gives

Building dependency tree
Reading state information... Done
gcc-3.4 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

then i tried changing symbolic links

> sudo rm cpp gcc g++
>sudo ln -s g++-3.4 g++
> sudo ln -s gcc-3.4 gcc
> sudo ln -s cpp-3.4 cpp

then

>sudo rm i486-linux-gnu-gcc i486-linux-gnu-g++ i486-linux-gnu-cpp

then

sudo ln -s cpp-3.4 i486-linux-gnu-cpp
sudo ln -s g++-3.4 i486-linux-gnu-g++
sudo ln -s gcc-3.4 i486-linux-gnu-gcc

but now when i try gcc -v

Unable to exec gcc.real: No such file or directory

then i tried

CC=gcc-3.4 CXX=g++-3.4
for cpp -v & g++-v it gives that its the gcc 3.4 but for gcc -v it gives

Unable to exec gcc.real: No such file or directory
can someone help??
thnaks!!!

knudfl 10-25-2009 05:17 AM

Welcome to LQ.
Quote:

sudo ln -s cpp-3.4 i486-linux-gnu-cpp
sudo ln -s g++-3.4 i486-linux-gnu-g++
sudo ln -s gcc-3.4 i486-linux-gnu-gcc
That will not work.

Please delete the links, linking is not the way to do it.
( Usually not, and definitely not the way you did.)
.. And you will have to reinstall gcc cpp g++ .

You can have as many compilers, as you want.
Examples, using compilers :

./configure CC=gcc-3.4 CXX=g++-3.4
./configure CC=gcc-4.1 CXX=g++-4.1
and / or
make CC=gcc-3.4 CXX=g++-3.4
make CC=gcc-4.1 CXX=g++-4.1

gcc-3.4 -o <object> file.c
.....
gcc -v , gcc-4.1 -v , gcc-3.4 -v .
.....

charix 10-26-2009 08:32 AM

hey thnx for ur advice

can u let me know the way to delete the links and how to install gcc,cpp,g++ again thnx

knudfl 10-26-2009 01:33 PM

Please open the terminal window and type these commands :

1) cd /usr/bin/
2) sudo rm cpp
3) sudo rm gcc
4) sudo rm g++
5) sudo rm i486-linux-gnu-cpp
6) sudo rm i486-linux-gnu-g++
7) sudo rm i486-linux-gnu-gcc
.. which should include all the links, you made.

8) sudo apt-get install cpp gcc g++
.....

John VV 10-26-2009 01:46 PM

why do you need gcc 3.4 ? for some very old code?
if it is newer code then some small hacks will get in compliance with gcc 4.4
http://gcc.gnu.org/gcc-4.3/porting_to.html
and
http://gcc.gnu.org/gcc-4.4/porting_to.html


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