XQLRSZ
XQLRSZ

Reputation: 140

No acceptable C compiler found in $PATH

So here's the situation. I want to setup a portable programming environment by installing my programming stuff (Vim, Clang, Git, GCC) in a single folder that I can create on any Mac. I am installing everything in /opt, which isn't there by default and I should have write permissions to create. I got Vim, Clang, and Git working by downloading the Xcode Command Line Tools and a program that can extract the contents of the PKG's. I put everything in their respective folders in /opt, e.g /opt/usr/bin. They are all doing dandy.

Here's the problem. I am trying to get GCC to work. I downloaded the OSX GCC Installer and did the same technique with GCC-4.2. The problem is that when I do a test compile, I run this. Edit: I get the same error message if I do CC=gcc-4.2

./configure --prefix=/opt/usr/bin

and receive

checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/gcc-master':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

This is strange because GCC-4.2 is in my $PATH

echo $PATH
/opt/usr/bin:/opt/usr/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

cd /opt/usr/bin ; ls | grep gcc
gcc
gcc-4.2
i686-apple-darwin11-gcc-4.2.1

FYI: 'gcc' is a symlink that doesn't point to anything.

which gcc-4.2
/opt/usr/bin/gcc-4.2

Upvotes: 1

Views: 13302

Answers (3)

Kiplangat Stanley
Kiplangat Stanley

Reputation: 11

The gcc compiler is not in your $PATH. It means either you dont have gcc installed or it's not in your $PATH variable.

To install gcc use this: (run as root) for debian and derivatives

apt-get install build-essential

Upvotes: 0

Fithe_Xanki
Fithe_Xanki

Reputation: 107

configure: error: no acceptable C compiler found in $PATH Before executing the ./configure command, i used the command:

sudo apt install gcc

And the error 'no acceptable ...' is solved.

Upvotes: 3

XQLRSZ
XQLRSZ

Reputation: 140

I solved this by adding this to my .zshrc. It forces any configure script to look for gcc-4.2 instead of gcc.

CC=/opt/usr/bin/gcc-4.2

Upvotes: 3

Related Questions