LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-31-2006, 04:18 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Rep: Reputation: 43
making old version of GCC your default compiler


Hello,
I've had a few problems compiling some code with debian etch which uses the GCC 4+ compiler. Code which worked great with the old GCC 3's. I've apt-get GCC version 3.3, but would like to know how to make this my default compiler, can anyone advise. Thanks in advance.
 
Old 07-31-2006, 05:08 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi

I'm using Sarge, not Etch, but on Sarge /usr/bin/gcc is just a symlink to gcc-3.3 so why not just change it to the gcc version you want?

Also, if the source has a proper configure script you can just set the CC/CXX environment variables to the gcc you want.
 
Old 07-31-2006, 06:23 AM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Just execute gcc-3.3 or gcc-3.4 from the command line instead of just gcc. (if you'd not like to tamper with the existing compiler sym links)
 
Old 07-31-2006, 08:45 AM   #4
coolguy_iiit
Member
 
Registered: Aug 2004
Posts: 51

Rep: Reputation: 15
" ln -s gcc-3.2 gcc " can be used to make the gcc 3.2 ur default compiler.
 
Old 08-01-2006, 04:21 PM   #5
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Cool

Quote:
Originally Posted by knobby67
Hello,
I've had a few problems compiling some code with debian etch which uses the GCC 4+ compiler. Code which worked great with the old GCC 3's. I've apt-get GCC version 3.3, but would like to know how to make this my default compiler, can anyone advise. Thanks in advance.
I run Slackware, and I wanted to run multiple gccs because of Ada. I found that too many things got messed up when I tried to have more than one gcc installed, so I set up another userid and wrote a custom logon profile for bash that sets everything up like I want. All my normal users on that machine get the current gcc, and my special user gets his own environment.

If you have problems with paths and environment variables and you can't get it to work, maybe something like what I did will work for you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
default array size for variable in gcc compiler mlaich Programming 13 01-04-2006 05:40 PM
How to change the gcc compiler's default version? aladin Linux - Software 8 10-09-2005 08:07 PM
Making make use a specific gcc version np_ Programming 2 09-01-2005 09:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration