LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2007, 05:51 PM   #1
matlaw
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Rep: Reputation: 0
redhat gcc compile error - no acceptable cc in $PATH


I'm having a bit of a problem installing gcc. I received a computer with redhat already installed. I checked the version and it says I have

Linux version 2.6.9-5.EL (bhcompile@decompose.build.redhat.com) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 Wed Jan 5 19:22:18 EST 2005

Except the problem is that I don't seem to have gcc.

which gcc

finds no gcc at all.

So then I tried installing gcc by downloading from gcc.gnu.org and following the instructions for compiling. The problem I got was that when I tried to compile, I get

checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

I changed $PATH to include where I think gcc is (where I unpacked the gcc code from gnu.org : /root/gcc4/gcc-4.2.1) but it still can't find it.

Any suggestions? I also tried adding /root/gcc4/gcc-4.2.1/gcc to the $PATH in case I didn't have the right directory, but still no luck.

Thanks for any help,

Matthew
 
Old 08-13-2007, 06:24 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Try looking in /usr/bin and /usr/local/bin, and see if you have a gcc and cc command there. Often they are links to programs with filenames that have the version appended. For the binaries, make sure that the paths are added to PATH in ~/.bash_profile or ~/.profile, or whatever you use. For the libraries, if any, that the program uses, make sure that the path to the libraries are in /etc/ld.so.conf. If not add them and run as root "ldconfig".

Or you could install them from the package.
Do you have a repository source. GNU GCC & G++ packages should be present. If not, you could try going to http://rpm.pbone.net. You can select your distro and version. Also, the link to the rpm will probably be a repository that you can add and then in the future you will be able to install packages using your package manager.

If you ran "make install", it probably copied the binaries and libraries under "/usr/" or "/usr/local/". You could read through the Makefile and see where the files were copied to. Look for the install: target. The base directory for the installation may be a variable defined near the top of the Makefile.
 
Old 08-13-2007, 06:32 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
If you ran "make install", it probably copied the binaries and libraries under "/usr/" or "/usr/local/". You could read through the Makefile and see where the files were copied to. Look for the install: target. The base directory for the installation may be a variable defined near the top of the Makefile.

Try looking in /usr/bin and /usr/local/bin, and see if you have a gcc and cc command there. Often they are links to programs with filenames that have the version appended. For the binaries, make sure that the paths are added to PATH in ~/.bash_profile or ~/.profile, or whatever you use. For the libraries, if any, that the program uses, make sure that the path to the libraries are in /etc/ld.so.conf. If not add them and run as root "ldconfig".

Or you could install them from the package.
Do you have a repository source. GNU GCC & G++ packages should be present. If not, you could try going to http://rpm.pbone.net. You can select your distro and version. Also, the link to the rpm will probably be a repository that you can add and then in the future you will be able to install packages using your package manager.
 
Old 08-13-2007, 06:38 PM   #4
matlaw
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Nothing in /usr/bin or /usr/local/bin. However, in response to

$ whereis gcc

I get

$ gcc: /usr/libexec/gcc

But in response to

$which gcc

I get

$ /usr/bin/which: no gcc in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/libexec/gcc:/usr/libexec)

Does that make any sense?
 
Old 08-13-2007, 06:53 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Look in /usr/libexec/ and make sure that gcc is a binary and not a directory. If it is a program enter "/usr/libexec/gcc -v". This will display the paths that gcc was build with. For program paths, make sure that they are added to your $PATH variable.

One of the values display will be --exec-prefix. For example, if it says --exec-prefix=/usr/local, then make sure that '/usr/local/bin' is in your path. For --lib-prefix, if it says --libexecdir=/usr/local/lib, make sure that /usr/local/lib is in /etc/ld.so.conf and run "ldconfig" as root.

I think you may have been better off installing from a package. The gnu package install seems to use some odd default directory locations. This may be done to prevent a conflict with another version. I'd have to look how Fedora Core sets gcc up. I usually use SuSE linux.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[FC5 - gcc install] error:no acceptable cc found in $PATH lachesis Linux - Newbie 3 09-25-2006 09:10 AM
cant compile>> no acceptable compiler found in $PATH toejamandrice Linux - Software 2 06-28-2006 07:34 PM
Configure: error: no acceptable cc found in $PATH chemicalvamp Linux - Software 6 02-21-2006 03:08 PM
error : no acceptable C compiler found in $PATH tzonga1 Linux - Software 1 03-02-2005 10:01 PM
configure: error: no acceptable cc found in $PATH nistelrooy Mandriva 3 10-07-2003 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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