LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-29-2010, 05:13 AM   #1
Nemoden
LQ Newbie
 
Registered: Mar 2010
Location: Vladivostok, Russia
Distribution: Ubuntu, CentOS, FreeBSD
Posts: 2

Rep: Reputation: 0
Problem with Gcc installation on Centos


I've installed GCC compiler:

Code:
yum install gcc
Added all directories to the $PATH
Code:
find / -name gcc
/usr/bin/gcc
/usr/local/bin/gcc
/usr/local/bin/gcc/gcc
/usr/local/bin/gcc/gcc/testsuite/ada/acats/tests/gcc
/usr/lib/gcc
/usr/libexec/gcc
[root@sql httpd-2.2.15]# PATH=/usr/bin:/usr/local/bin:/usr/local/bin/gcc:/usr/local/bin/gcc/gcc/testsuite/ada/acats/tests:/usr/lib:/usr/libexec:$PATH
[root@sql httpd-2.2.15]# which gcc
/usr/bin/which: no gcc in (/usr/bin:/usr/local/bin:/usr/local/bin/gcc:/usr/local/bin/gcc/gcc/testsuite/ada/acats/tests:/usr/lib:/usr/libexec:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
and anyway ./configure does not work for the reason of
Quote:
configure: error: no acceptable C compiler found in $PATH
Any ideas?

Code:
which gcc
/usr/bin/which: no gcc in (/usr/bin:/usr/local/bin:/usr/local/bin/gcc:/usr/local/bin/gcc/gcc/testsuite/ada/acats/tests:/usr/lib:/usr/libexec:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

Last edited by Nemoden; 03-29-2010 at 05:14 AM.
 
Old 03-29-2010, 05:16 AM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
Is the file /usr/bin/gcc executable? Sounds like something when awry in the install phase. Here's my file details:-
Code:
2.6.18-164.15.1.el5.centos.plus[root@www httpd]# sum /usr/bin/gcc
56896   198
2.6.18-164.15.1.el5.centos.plus[root@www httpd]# ls -l /usr/bin/gcc
-rwxr-xr-x 2 root root 202368 Jan 14 14:46 /usr/bin/gcc
2.6.18-164.15.1.el5.centos.plus[root@www httpd]# /usr/bin/gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
2.6.18-164.15.1.el5.centos.plus[root@www httpd]#
 
Old 03-29-2010, 06:57 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,273

Rep: Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663
Welcome to LQ. .. .. ..
Quote:
/usr/local/bin/gcc
/usr/local/bin/gcc/gcc
/usr/local/bin/gcc/gcc/testsuite/ada/acats/tests/gcc
There should be no GCC whatsoever in /usr/local/bin/ !

# yum install gcc
.. provides a GCC not very usable.
You will need : # yum install glibc-devel glibc-headers
Also recommended : # yum install gcc-c++
.....
Quote:
Added all directories to the $PATH
Not quite clear, why you would do such a thing.
Software installed with yum ( = packages ) :
No setup or PATH setting is required.
( For 99 percent of the packages.)
.....

Last edited by knudfl; 03-29-2010 at 07:12 AM.
 
Old 03-30-2010, 03:48 AM   #4
Nemoden
LQ Newbie
 
Registered: Mar 2010
Location: Vladivostok, Russia
Distribution: Ubuntu, CentOS, FreeBSD
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Welcome to LQ. .. .. ..
knudfl, Thanks. I found this forum a long time ago, but registered just now. Due to my work I need to work on Ubuntu (as desktop), FreeBSD and CentOS (as server) a lot and it is really hard for Windows 7 user
Installation of gcc wasn't a problem on Ubuntu at all on my desktop. I don't know why I've faced with it on CentOS. Anyway it's my mistake - I attempted to install it from sources (not from yum repos).

My problem is solved. Although, I'd narrate what I've done to fix it (maybe somebody has the same issue):

Code:
Package glibc-devel-2.5-42.i386 already installed and latest version                                                                                                                                              
Package glibc-headers-2.5-42.i386 already installed and latest version
Installed gcc-c++

Code:
Not quite clear, why you would do such a thing.
Software installed with yum ( = packages ) :
No setup or PATH setting is required. 
( For 99 percent of the packages.)
I thought it might solve the problem

Code:
[root@sql httpd-2.2.15]# /usr/bin/gcc
-bash: /usr/bin/gcc: is a directory
I found appropriate Gcc compiler named gcc44 /usr/bin.
Made a symbolyc link:
Code:
ln -s -T /usr/bin/gcc44 /usr/bin/gcc
Code:
[root@sql httpd-2.2.15]# ls -l /usr/bin | grep gcc
lrwxrwxrwx 1 root root          3 Mar 30 08:08 cc -> gcc
lrwxrwxrwx 1 root root         14 Mar 30 08:23 gcc -> /usr/bin/gcc44
-rwxr-xr-x 2 root root     218448 Sep  4  2009 gcc44
-rwxr-xr-x 1 root root     196692 Sep  3  2009 gcc;4bafd274
-rwxr-xr-x 1 root root     196692 Sep  3  2009 gcc;4bafd6a6
-rwxr-xr-x 2 root root     196692 Sep  3  2009 gcc;4bb116e9
-rwxr-xr-x 2 root root     218448 Sep  4  2009 i386-redhat-linux6E-gcc44
-rwxr-xr-x 2 root root     196692 Sep  3  2009 i386-redhat-linux-gcc
All this mess is from my previous attempts to install gcc.
For example I have no idea what is
gcc;4bafd274
etc, but at least now everything works just fine and I've installed apache2.

Last edited by Nemoden; 03-30-2010 at 04:00 AM.
 
Old 03-30-2010, 07:05 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,273

Rep: Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663Reputation: 2663
Please don't use root for "user commands".
Root is for administrative tasks only !
Code:
     1	ls -l /usr/bin | grep gcc
     2	lrwxrwxrwx 1 root root           3 Aug  7  2009 cc -> gcc
     3	-rwxr-xr-x 2 root root      196644 Jan 21  2009 gcc
     4	-rwxr-xr-x 2 root root       89728 Mar 23  2007 gcc34
     5	-rwxr-xr-x 2 root root      208480 Jan 21  2009 gcc43
     6	-rwxr-xr-x 1 root root        2018 Mar 24  2007 gccmakedep
     7	-rwxr-xr-x 2 root root      208480 Jan 21  2009 i386-redhat-linux6E-gcc43
     8	-rwxr-xr-x 2 root root      196644 Jan 21  2009 i386-redhat-linux-gcc
     9	-rwxr-xr-x 2 root root       89728 Mar 23  2007 i386-redhat-linux-gcc34
The default gcc ( line 3 (and 8 )) is gcc-4.1.2,
the one you get with # yum install gcc .

So it's a mystery, why it is / was missing on your OS.
.....
These three, you also show :
gcc;4bafd274
gcc;4bafd6a6
gcc;4bb116e9
... I don't know, what it is. May be inspect the files.
Please try this command file /usr/bin/<file-to-be-tested>.
.....
.....

I have gcc43 instead of your gcc44.
Code:
rpm -qa --last | grep gcc
compat-gcc-34-c++-3.4.6-4                     Sat 16 Jan 2010 02:51:26 PM EST
gcc-gfortran-4.1.2-44.el5                     Wed 11 Nov 2009 08:00:31 PM EST
gcc43-c++-4.3.2-7.el5                         Mon 09 Nov 2009 09:42:30 PM EST
gcc43-4.3.2-7.el5                             Mon 09 Nov 2009 09:37:07 PM EST
compat-gcc-34-g77-3.4.6-4                     Fri 23 Oct 2009 03:26:06 AM EDT
compat-gcc-34-3.4.6-4                         Fri 23 Oct 2009 03:26:05 AM EDT
gcc-c++-4.1.2-44.el5                          Fri 07 Aug 2009 07:16:54 PM EDT
gcc-4.1.2-44.el5                              Fri 07 Aug 2009 07:13:30 PM EDT

Last edited by knudfl; 03-30-2010 at 07:07 PM.
 
  


Reply

Tags
gcc


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
[SOLVED] Gcc Installation problem malickhat Linux - Newbie 18 11-05-2009 07:41 AM
Installation problem in CentOS 5.2 ? openSourceLover Linux - Server 4 10-23-2009 09:26 AM
GCC installation problem nicky43 Linux - Software 3 07-22-2006 06:59 AM
Problem with installation of gcc 3.4.3 lxeye Programming 5 01-16-2005 12:03 PM
Gcc installation problem Agileuk Linux - Newbie 2 09-28-2003 07:11 PM


All times are GMT -5. The time now is 02:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration