Homebrew can't find gcc

I had problems getting homegrown to work on Leo. For some reason, it builds clang, not gcc.

==> Upgrading gnutls ... checking for gcc... /usr/bin/clang checking whether the C compiler works... no 

'brew doctor says:

 We couldn't detect gcc 4.2.x. Some formulae require this compiler. NOTE: Versions of XCode newer than 4.2 don't include gcc 4.2.x. 

NOTE. I have already installed the command line tools from Xcode, including gcc.

 $ which gcc /usr/bin/gcc $ gcc -v gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) 

How to make brew use gcc?

+6
source share
2 answers

After Xcode 4.2, Apple stopped distributing gcc using Xcode. Instead, they distribute llvm-gcc (and clang) which are not gcc. You can see this with gcc -v, just like you: it shows LLVM build .

To use gcc, you will have to compile it yourself. There is a homegrown formula for this, but you will need to use homebrew / dupes with brew tap homebrew/dupes .

Please note that today the gcc formula does not work if compiled with clang. You must install it with brew install --use-llvm gcc .

Also note that Homebrew is clearly looking for gcc-4.2. You will need to create a symlink for Homebrew to find gcc.

+12
source

If you have Yosemite to watch this video, it will tell you Xcode directly from the command line when installing Homebrew

http://dimecasts.net/Casts/CastDetails/218

0
source

Source: https://habr.com/ru/post/914473/


All Articles