LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2009, 05:34 AM   #1
salmanmanekia
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Rep: Reputation: 0
gcc versions installed on my system and which one is default..??


Hello,
I am very new to linux and have been working on a system not configured or installed by me..and i am supposed to know how many versions of gcc are installed on my system and which one is the default one..??..
any way out to this problem...
Thanks All
-MuHaMMeD Salman
 
Old 07-24-2009, 06:11 AM   #2
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I don't know about multiple versions, but have you tried `gcc -v`?
 
Old 07-24-2009, 06:27 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Quote:
how many versions of gcc are installed on my system and which one is the default one..??..
#rpm -qa | grep gcc
it will output all rpms which are related to gcc and version
 
Old 07-24-2009, 11:50 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
what is the distro and version? that would help
fedora 11 uses gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)
RHEL 5.3 uses gcc 4.3 ? or is it 4.2
 
Old 07-24-2009, 12:26 PM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by salmanmanekia View Post
i am supposed to know how many versions of gcc are installed on my system
That might be very difficult. There is a lot of flexibility when installing gcc from source. You can easily customize its name and/or location to install a version of gcc that you can use on demand without conflicting with the default version or other extra versions.

The many versions of gcc on the systems where I work are in strange automounts across the network, so they aren't in the database used by locate and some of the auto mount directories seem to be invisible to wild cards until explicitly accessed. So on my system finding the gcc executables at all would be hard if I didn't know where to look.

But on a less strange system, I expect the main executable for any version of gcc is likely to have "gcc" as part of its name. It shouldn't be too hard to run a search for all files that have "gcc" in their name (likely to be quite a lot) and automatically run "file" for each to filter for just the ones that are ordinary executables (which should be a more manageable list) and then just look at the list and guess/test (should be easy) which are the main executables of installed versions of gcc.

Quote:
and which one is the default one..??..
But that ought to be easy. As karamarisan said
gcc -v

Last edited by johnsfine; 07-24-2009 at 12:36 PM.
 
  


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
Link Error: Two versions of boost installed on system simulacrum111 Programming 1 07-19-2009 06:24 PM
default gcc installed from hardy cd does not produce executables raphtor Linux - Newbie 6 12-30-2008 05:37 PM
GCC not installed by default in SUSE 10.1? *Xenny* SUSE / openSUSE 3 08-07-2006 09:02 AM
Is it possible to have two different versions of GCC in the same system ?? nasty_daemon Linux - Software 2 09-07-2005 10:49 AM
Can you have two different versions of gcc on the same system? the theorist Linux - Software 1 02-23-2004 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:03 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