Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The default GCC package available in the Fedora 16 repositories is gcc-4.6. I need to install gcc-4.5 on my system.
I downloaded the packages from the kijo repository, but when I try to install them it shows that a newer libstdc++4.6 is installed. If I try to uninstall libstdc++4.6 it tries to uninstall the system itself! (Almost every package in the system). And it would not allow me install libstdc++4.5 along with libstdc++4.6.

Is there a easy way that I can install gcc-4.5 on my system?

share|improve this question
    
Why do you think that you need 4.5? –  Ignacio Vazquez-Abrams Feb 21 '12 at 5:01
    
@IgnacioVazquez-Abrams well the build of a particular package has succeded on gcc4.5 when it is throwing up errors in gcc4.6 . I have been asked to try the build using gcc4.5. –  salsabear Feb 21 '12 at 5:05
    
Erroring out on a newer version of GCC usually means that the code wasn't written according to the standard in the first place. –  Ignacio Vazquez-Abrams Feb 21 '12 at 5:07
    
@IgnacioVazquez-Abrams I feel the same , but I cannot help it –  salsabear Feb 21 '12 at 5:24
    
Perhaps you should kick the error messages over to Stack Overflow and let them have a crack at it. –  Ignacio Vazquez-Abrams Feb 21 '12 at 5:26

1 Answer 1

up vote 1 down vote accepted

Getting the build errors worked out is preferable, so I hope that works out for you.

But it is possible to install alternate versions of gcc on Fedora. Just not from packages -- you'll need the source, available from http://gcc.gnu.org/. Look to download gcc-4.5.3.tar.gz from one of the download mirrors.

The following is modeled after some info by Zhongliang Chen on installing gcc-4.3 on Fedora 15.

Download and unpack the gcc source tarball. Make sure your Fedora 16 has the packages necessary for building:

yum install gcc mpfr-devel libmpc libmpc-devel glibc-devel

Then create a new, empty build directory and build gcc with a suffix of 45 -- you'll build compilers gcc45 and g++45 for example. You might want a new, separate install directory like /usr/local/gcc45/

$cd PATH_TO_BUILD_DIR
$PATH_TO_SOURCE_DIR/configure --prefix=PATH_TO_INSTALL_DIR --program-suffix=45 --enable-languages=c,c++
$make
$sudo make install
share|improve this answer
    
Hey thanks. That took a while to compile but did work! –  salsabear Feb 21 '12 at 9:50
    
@Vamsi -- glad it helped. Could you mark my answer as accepted, if you are satisfied with it? –  Lars Rohrbach Feb 21 '12 at 19:41
    
after installation, I used update-alternatives to use the newly installed gcc and g++. How could I also update the libraries similarly? It seems like my program is still using the libraries of the previously installed gcc. And it seems like toolchain was built without thread support. I am also going to use threads. – Vamsi 1 min ago edit –  salsabear Feb 22 '12 at 1:07
    
Is this for running your program or for building your program? For building with your gcc45, you can add some -I and -L flags pointing to your new install include and lib directories. For running, perhaps modify your LD_LIBRARY_PATH similarly? –  Lars Rohrbach Feb 22 '12 at 7:57
    
the messed up part is that LD_LIBRARY_PATH only has a single directory which I am sure does not have any gcc libraries. –  salsabear Feb 22 '12 at 12:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.