LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-23-2011, 11:06 AM   #1
Mark8812
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
What versions of g++ and gcc come standard with RHEL 5.3


This is a little long, but I want to provide as much detail as possible, so please bear with me.

I ran into an issue that was written up here on LQ and/or on other sites, the one dealing with an error similar to the following one:
error trying to exec 'cc1plus': execvp: No such file or directory
The solution seems is to make g++ and gcc versions consistent. I've since remedied that, but am slightly confused with my findings and concerned with my solution.

When I first looked in /usr/bin for all references to g++ and gcc, I saw that there were two version of gcc and one version of g++:

$cd /usr/bin
$ls -al | grep -e 'g++\|gcc'


lrwxrwxrwx 1 root root 3 Jan 21 16:28 cc -> gcc
-rwxr-xr-x 3 root root 94784 Aug 23 2006 g++34
-rwxr-xr-x 1 root root 202320 ??? ?? ???? gcc
-rwxr-xr-x 2 root root 92916 Aug 23 2006 gcc34
-rwxr-xr-x 3 root root 94784 Aug 23 2006 i386-redhat-linux-g++34
-rwxr-xr-x 1 root root 202320 Sep 18 2008 i386-redhat-linux-gcc
-rwxr-xr-x 2 root root 92916 Aug 23 2006 i386-redhat-linux-gcc34


(Note the "??? ?? ????" as date for gcc. I've since made some changes, but this was essentially the set of gcc and g++ files that existed before I started.)

I'm told that the system I'm using is an "out of the box" installation, i.e. no modifications. As installed, gcc is the newer version and does not correspond to g++34:

$gcc --version

gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Confusion and concern:


When I use makefiles from software I've adopted, I run into the cc1plus problem eluded to above. The cc1plus error occurred because the makefiles expected there to be a command named "g++," so I created a symbolic link, pointing /usr/bin/g++ -> /usr/bin/g++34. And in doing so, g++ was not consistent with gcc. I've since fixed that, i.e. copied the gcc34 version to gcc and my software builds fine.

My question are:

1. Will copying the gcc34 version to gcc cause issues in the future, possibly related to upgrades and/or istallations of other packages that rely on "gcc"? Currently the files are as follows:
lrwxrwxrwx 1 root root 3 Jan 21 16:28 cc -> gcc
lrwxrwxrwx 1 root root 5 Feb 17 15:37 g++ -> g++34
-rwxr-xr-x 3 root root 94784 Aug 23 2006 g++34
-rwxr-xr-x 1 root root 92916 Feb 22 11:47 gcc
-rwxr-xr-x 2 root root 92916 Aug 23 2006 gcc34
-rwxr-xr-x 3 root root 94784 Aug 23 2006 i386-redhat-linux-g++34
-rwxr-xr-x 1 root root 202320 Sep 18 2008 i386-redhat-linux-gcc
-rwxr-xr-x 2 root root 92916 Aug 23 2006 i386-redhat-linux-gcc34
2. Were the g++ and gcc files in /usr/bin the "out of the box" versions?

3. How can I answer a question like this in the future, without posting to LQ, i.e. is there a reference to find this type of information?

Thanks in advance.
Mark
 
Old 02-23-2011, 04:38 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Default versions : gcc / gcc-c++ (g++) version 4.1.2.

# yum install gcc-c++ : Will install the g++ compiler and update the
may be corrupted /usr/bin/gcc.

/usr/bin/gcc34, /usr/bin/g++34 : Please use 'rpm -qf /usr/bin/g++34'
to know the package, that installed the file.
( compat-gcc-34 , compat-gcc-34-c++ : The old "3.4.6".)

Quote:
Will copying the gcc34 version to gcc cause issues in the future, possibly
related to upgrades and/or istallations of other packages that rely on "gcc" ?
Certainly not a good idea to use gcc34 as default compiler : You can't test,
if your files will work with the later gcc-4.1.2.
Dependency : I don't think, any packages depend on gcc-4.1.2 :
And a dependency check is not done in /usr/bin/, but in the rpm data base.
I.e. Changing some files ( or deleting files ), the rpm data base will not know
anything at all about that.

..

Last edited by knudfl; 02-23-2011 at 04:42 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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Instal GCC without prior gcc versions. shri_tech007 Linux - Software 4 12-09-2010 03:15 PM
Using different GCC versions Denisius Linux - Software 7 01-12-2009 07:04 AM
Multiple versions of GCC Denisius Slackware 11 11-15-2007 08:39 AM
gcc versions compatibility with kernel versions.. mahesh_manthapuri SUSE / openSUSE 1 03-22-2006 01:28 AM
Need Two Versions of gcc on FC4 yellowdognerd Linux - Software 9 09-09-2005 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration