LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack 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,183

Rep: Reputation: 113Reputation: 113
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
Guru
 
Registered: Aug 2005
Posts: 12,112

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
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
Senior Member
 
Registered: Dec 2007
Distribution: Centos
Posts: 4,968

Rep: Reputation: 1074Reputation: 1074Reputation: 1074Reputation: 1074Reputation: 1074Reputation: 1074Reputation: 1074Reputation: 1074
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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/Novell 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


All times are GMT -5. The time now is 05:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration