LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-16-2007, 02:17 AM   #1
tengun
LQ Newbie
 
Registered: Sep 2007
Distribution: Linspire
Posts: 8

Rep: Reputation: 0
"No C compiler found in $PATH" - why not?


I know this has probably been asked multiple times before, but:

I installed gcc (GNU c compiler) v 2.95 from CNR so that I could compile sodipodi. However, after it was installed to /usr/bin/, I found that ./configure still kept telling me "$no acceptable c complier found in $PATH". So, I created a symlink to gcc, still got an error, even copied the binary from /usr/bin to sodipodi's directory, hoping that that would put a c compiler in $PATH, and ran ./configure again. Still no acceptable c compiler found in $PATH.

How do I set gcc as my default c compiler so that ./configure will stop giving me this error? I'm using Linspire, by the way, if you hadn't already figured that out when I mentioned "CNR".
 
Old 09-16-2007, 02:28 AM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Go to a terminal and type "echo $PATH" without the quotes and see if /usr/bin is in it. If all else fails, you could try a symlink in /bin, but /usr/bin should be in everyone's path. Hrmm.
 
Old 09-16-2007, 02:40 AM   #3
tengun
LQ Newbie
 
Registered: Sep 2007
Distribution: Linspire
Posts: 8

Original Poster
Rep: Reputation: 0
This is the output...

/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/bin:/usr/share/qt3/bin

I don't quite understand it. /usr/bin/ is the second path in $PATH. Do the paths need to be in a different order? If so, how do I set $PATH?

Edit:
I created a symlink to gcc in /bin, but it didn't satisfy ./configure.

Last edited by tengun; 09-16-2007 at 02:43 AM.
 
Old 09-16-2007, 03:10 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The problem can be related to the fact that the available gcc compiler is not suitable to the compilation for some reason. Maybe a too old version? Anyway, to force using a compiler you can define the environment variable
Code:
export CC=gcc
before launching ./configure. Second, would be useful to inspect the gcc executable by
Code:
file gcc
you should obtain something like (if you are on a 32-bit machine)
Code:
/usr/bin/gcc-4.1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, stripped
if not, probably something went wrong when installing the compiler.
 
Old 09-16-2007, 02:00 PM   #5
tengun
LQ Newbie
 
Registered: Sep 2007
Distribution: Linspire
Posts: 8

Original Poster
Rep: Reputation: 0
Well, I tried force CC=gcc, and it did recognize gcc. However, it then told me that my "C compiler cannot create executables".

When I ran file, the output was:

Quote:
gcc-2.95: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped
So, since I knew I might be able to use apt-get to find a more recent binary, I issued
Code:
apt-get install gcc-4.1
...however, apt-get couldn't find the package.


I am using gcc version 2.95 (I have no idea why CNR would have an outdated version, and the most recent one they have is version 3.4) - where can I find a more recent binary?
 
Old 09-16-2007, 05:12 PM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by tengun View Post
So, since I knew I might be able to use apt-get to find a more recent binary, I issued
Code:
apt-get install gcc-4.1
...however, apt-get couldn't find the package.
Hmmm... I'm not used to apt-get, nor I know about Linspire distribution, but you can try
Code:
apt-get install gcc
without version number, or
Code:
apt-get install build-essential
then report exactly any eventual error message. I'm sure some other member more experienced than me about apt-get can help to go through this issue. Cheers!
 
Old 09-16-2007, 08:40 PM   #7
tengun
LQ Newbie
 
Registered: Sep 2007
Distribution: Linspire
Posts: 8

Original Poster
Rep: Reputation: 0
Code:
dell:~# apt-get install gcc
Reading Package Lists... Done
Building Dependency Tree... Done
Package gcc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package gcc has no installation candidate
Code:
dell:~# apt-get install build-essential
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package build-essential
dell:~#
Hmm... the package is "missing, has been obsoleted, or
is only available from another source"?
 
Old 09-22-2007, 04:20 PM   #8
tengun
LQ Newbie
 
Registered: Sep 2007
Distribution: Linspire
Posts: 8

Original Poster
Rep: Reputation: 0
Update: I uninstalled my old, outdated version of GCC and replaced it with a less obsolete version (3.4). I set it as the default with "export CC=gcc", and it gave me the same error until I copied the "gcc-3.4" file to just "gcc". Then configure ran fine, generating a couple screens worth of output, and all seemed to be fine until the end. Configure just required me to have gcc, g++, gpp and pkg-config, and they had to be those exact names or configure wouldn't find them (mine had names like gcc-3.4 and g++-3.4). My cpp wasn't sane because I didn't have the GNU c++ compiler, g++ (which presumably told gpp how to function).

To make a long story short, I got it solved, and if anyone using the Linspire distro has my problem, they should visit my CNR aisle.

Last edited by tengun; 09-22-2007 at 07:36 PM.
 
  


Reply

Tags
gcc, path



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
How to install GCC? error "no acceptable compiler found" rohan208 Red Hat 3 04-19-2006 05:53 AM
"No acceptable C compiler found in $PATH" LinuxSeeker Ubuntu 6 03-07-2006 03:28 PM
I'm just trying to install Gaim... "no acceptable C compiler found in $PATH jimothy05 Mandriva 2 09-30-2004 02:10 AM
"no acceptable C compiler found in $PATH" any ideas? SamJ Linux - Newbie 7 02-18-2004 03:33 PM

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

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