-   Linux - Software (
-   -   How to change the gcc compiler's default version? (

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?


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


rpm -q -a | grep gcc

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


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:

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 06:46 PM.