LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to change the gcc compiler's default version? (https://www.linuxquestions.org/questions/linux-software-2/how-to-change-the-gcc-compilers-default-version-354762/)

aladin 08-18-2005 11:24 PM

How to change the gcc compiler's default version?
 
hello everyone
I have a system of FC4, I want to change the default gcc compiler to gcc3.2 not gcc4.0 for installing mplayer,how should I do?
Thanks!

Aldin

thermite_1033 08-19-2005 03:54 AM

./configure CC=/path/to/gcc/of/your/choice

RottenMutt 09-11-2005 10:16 AM

can i install another version of gcc with gcc 4 installed?
I'm trying to instal mplayer and it wants gcc 2.95.x or 3.2.x

Code:

rpm -q -a | grep gcc
gcc-gfortran-4.0.1-4.fc4
gcc-c++-4.0.1-4.fc4
gcc-4.0.1-4.fc4
gcc-java-4.0.1-4.fc4
libgcc-4.0.1-4.fc4

where do i get a rpm of gcc 3.2 and do i just install it as "rpm -ivh"?
thanks for the help

RottenMutt 09-11-2005 12:16 PM

help please :)

thermite_1033 09-11-2005 01:45 PM

sory i use slackware so i can only gues

to install other versions of gcc just do this

rpm gcc-version --prefix=/opt/gcc-version



then to use this gcc for compiling

./configure CC=/opt/gcc-version/bin/gcc

RottenMutt 09-12-2005 09:43 PM

Quote:

Originally posted by thermite_1033
to install other versions of gcc just do this
rpm gcc-version --prefix=/opt/gcc-versionc

I tried but it didn't install. nothing in "/opt/ gcc-3.4.2-6" and rpm -q -a | grep gcc yeilds version 4

thermite_1033 09-13-2005 08:58 AM

have you tried it with the option "rpm --root=/opt" ?

sundialsvcs 09-13-2005 10:08 AM

You can control the version of GCC that is invoked with the GCC_EXEC_PREFIX environment-variable. Refer to info gcc for more details.

It is actually quite common to have more than one version of a compiler installed on the system at the same time. People who are "cross-compiling" applications (running a compiler on machine-X that generates code for machine-Y) do this all the time.

It can also be useful to read the section about specs files. The info node under "spec files" says this:
Quote:

gcc is a driver program. It performs its job by invoking a sequence of other programs to do the work of compiling, assembling and linking. GCC interprets its command-line parameters and uses these to deduce which programs it should invoke, and which command-line options it ought to place on their command lines. This behavior is controlled by "spec strings." In most cases there is one spec string for each program that GCC can invoke, but a few programs have multiple spec strings to control their behavior. The spec strings built into GCC can be overridden by using the -specs= command-line switch to specify a spec file.

"Spec files" are plaintext files that are used to construct spec strings. They consist of a sequence of directives separated by blank lines....


RottenMutt 10-09-2005 08:07 PM

I have tried to install but no luck... I'm trying to install gcc-3.4 so i can compile mplayer.

rpm -ivh --prefix /opt/gcc-3.4.2-6 gcc-3.4.2-6.fc3.src.rpm

the above don't work:(


All times are GMT -5. The time now is 02:31 AM.