LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install an older version of gcc compiler (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-an-older-version-of-gcc-compiler-696095/)

teki 01-09-2009 09:05 AM

How to install an older version of gcc compiler
 
hello!
i'm using Fedora 10.
i need to instal an older version of gcc compiler. my default version is
Quote:

gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)
i have already installed compact-gcc-34, but the compilation didn't pass. now, on other computer it apparently works with
Quote:

gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
the problem is that i cannot install this 4.1. gcc. here's what happens when i try to install it:
Quote:

[root@jimi Download]# yum install gcc-c++-4.1.2-33.i386.rpm
Loaded plugins: refresh-packagekit
skype | 951 B 00:00
fedora | 2.8 kB 00:00
rpmfusion-free-updates | 2.7 kB 00:00
rpmfusion-free | 2.7 kB 00:00
updates | 2.3 kB 00:00
Setting up Install Process
Parsing package install arguments
Examining gcc-c++-4.1.2-33.i386.rpm: gcc-c++-4.1.2-33.i386
gcc-c++-4.1.2-33.i386.rpm: does not update installed package.
Nothing to do
any suggestions?

teki 01-10-2009 02:03 AM

i also tried this:
Quote:

[root@jimi Download]# rpm --install gcc-c++-4.1.2-33.i386.rpm
warning: gcc-c++-4.1.2-33.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
gcc = 4.1.2-33 is needed by gcc-c++-4.1.2-33.i386
libstdc++ = 4.1.2-33 is needed by gcc-c++-4.1.2-33.i386
libstdc++-devel = 4.1.2-33 is needed by gcc-c++-4.1.2-33.i386
maybe someone has any idea how to fix this...

teki 01-10-2009 05:38 AM

so i tried another thing:
Quote:

[root@jimi Download]# rpm --install --nodeps gcc-c++-4.1.2-33.i386.rpm
here's what i get:
Quote:

warning: gcc-c++-4.1.2-33.i386.rpm: Header V3 DSA signature: NOKEY, key ID bb4b29a7
package gcc-c++-4.3.2-7.i386 (which is newer than gcc-c++-4.1.2-33.i386) is already installed
file /usr/bin/c++ from install of gcc-c++-4.1.2-33.i386 conflicts with file from package gcc-c++-4.3.2-7.i386
file /usr/bin/g++ from install of gcc-c++-4.1.2-33.i386 conflicts with file from package gcc-c++-4.3.2-7.i386
file /usr/bin/i386-redhat-linux-c++ from install of gcc-c++-4.1.2-33.i386 conflicts with file from package gcc-c++-4.3.2-7.i386
file /usr/bin/i386-redhat-linux-g++ from install of gcc-c++-4.1.2-33.i386 conflicts with file from package gcc-c++-4.3.2-7.i386
file /usr/share/man/man1/g++.1.gz from install of gcc-c++-4.1.2-33.i386 conflicts with file from package gcc-c++-4.3.2-7.i386
is there a way to install in another directory so there is no conflict? or do i have to replace gcc-c++-4.3.2-7.i386 with an older version?

knudfl 01-11-2009 04:43 AM

The package 'gcc-c++-4.1.2-33.i386.rpm' provides no file
by name 'gcc' but '/usr/bin/c++ , for c++ code only.
For c++ I recommend 'compat-gcc-34-c++'

I'd guess, that a modified gcc-4.1.2-33.i386.rpm from Fedora 8
http://download.fedora.redhat.com/pu...6/os/Packages/
will work in Fedora 10, works with no problems in Fedora 9.
EDIT: Suse gcc41 works. See link below. Post #6.
'cpp-4.1.2-33.i386.rpm' is also needed.

The method is to unpack the rpm's, remove conflicting files,
rename files in /usr/bin, and the most important before use :
# 'chmod -R 0755 <everything>'

The modified result can be copied into Fedora 10, or repacked
to be installed with # 'rpm -Uvh <package> <package>'

I made 2 rpm's, compat41-gcc-4.1.2-33 i386 ( 250 kB ) and
compat41-cpp-4.1.2-33 i386 ( 2.4 MB )
EDIT : For gcc / g++ 4.1 : Use the suse gcc41 packages. Post #6.
http://download.opensuse.org/distrib...oss/suse/i586/
....
Example command using the above :
'CC=gcc-4.1 CXX=g++34 ./configure'
....

thinhtelecom 07-04-2010 10:00 PM

Hi !

I am using Fedora 11. Now I want to install gcc 3.3; however, I still don't know specific steps to do it.

Could you give me some advices.
Thanks in advanced !

knudfl 07-05-2010 02:38 AM

@ thinhtelecom , post # 5. Welcome to LQ. .. :)

1) yum install rpm
.. to be sure you have a version with lzma.
( The oldest version has no lzma decompression.)

2)
http://download.opensuse.org/distrib...oss/suse/i586/
cpp33-3.3.3-15.3.i586.rpm gcc33-3.3.3-15.3.i586.rpm
gcc33-c++-3.3.3-15.3.i586.rpm libstdc++33-devel-3.3.3-15.3.i586.rpm
And may be libstdc++33-3.3.3-15.3.i586.rpm.
..

thinhtelecom 07-10-2010 09:40 AM

Quote:

Originally Posted by knudfl (Post 4024006)
@ thinhtelecom , post # 5. Welcome to LQ. .. :)

1) yum install rpm
.. to be sure you have a version with lzma.
( The oldest version has no lzma decompression.)

2)
http://download.opensuse.org/distrib...oss/suse/i586/
cpp33-3.3.3-15.3.i586.rpm gcc33-3.3.3-15.3.i586.rpm
gcc33-c++-3.3.3-15.3.i586.rpm libstdc++33-devel-3.3.3-15.3.i586.rpm
And may be libstdc++33-3.3.3-15.3.i586.rpm.
..

Thanks !

I installed these packages, but how can I confirm whether the gcc 3.3 was installed successfully.

Regards,

knudfl 07-10-2010 09:50 AM

The testing commands are :
gcc-3.3 -v
g++-3.3 -v

Using gcc-3.3 : gcc-3.3 <code>.c

When you have a Makefile : make CC=gcc-3.3 CXX=g++-3.3
..


All times are GMT -5. The time now is 10:43 AM.