How to change dafault gcc

Mon Apr 7 20:50:00 GMT 2008

Thanks a lot for You help Tom.

Today, finaly I understand You suggestion about CXX and CC environment 
I add file to /etc/profilr.d directory
and everything works fine. When I change export CC=/user/bin/gcc-X.Y.Z then 
I change default compiler to X.Y.Z.
I try the same beafor but I don't discover so I must relogin. When I'm 
logout and login again then everythings work ok.

Very very thanks for You help and patience.


----- Original Message ----- 
From: "Tom Browder" <>
To: "wp" <>
Cc: <>
Sent: Monday, April 07, 2008 12:47 PM
Subject: Re: How to change dafault gcc

> On Sun, Apr 6, 2008 at 12:47 PM, wp <> wrote:
>> Hi
>>  I have installed gcc-4.0.1 in my mandriva2006 as default gcc compiler. 
>> (its
>>  a an rpm package)
>>  I compile and install another gcc (4.2.0 or 3.4.6)
>>  I try change symlinks. I try change alternatives. Everything looks Ok.
>>  when I type gcc -- version I have 4.2.0. But when I try rebuild surces 
>> by
>>  rpmrebuild it's still use default  gcc (4.0.1) and i have compilation 
>> error
>>  (incompatible with gcc 4.0.1).
>>  When I uninstall rpm package with gcc-4.0.1 everything works fine,
>>  rpmrebuild goes without any error. But when I install gcc-4.0.1 again, 
>> then
>>  it'is again default gcc and again can't rebuild my source.
>>  My question is: How to change default gcc ?
> Did you try my suggestion to set the CXX and CC environment variables
> to the desired compilers?  I use rpm build all the time and that seems
> to work for me.
> -Tom

More information about the Gcc-help mailing list