9

I want to compile a C library on my MacOS Sierra system, but I am getting the following error:

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/Users/macuser/Downloads/libr':
configure: error: C compiler cannot create executables

I tried setting the symlink as suggested in OS X 10.9.2: checking whether the C compiler works... no :

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeD‌​efault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.‌​11.xctoolchain

I tried setting the CC path and install xcode as in https://apple.stackexchange.com/questions/216573/cant-compile-source-code-on-mac :

export CC=clang
xcode-select --install

and accept the license. But nothing worked. Are there any new steps to consider on Sierra to get the command line tools running properly?

1 Answer 1

16

Start Xcode, select 'Preferences', then 'Locations'. You'll notice a dropdown control at 'Command Line Tools'. Select the newest version, close the dialog window, then call brew again. Restart your computer and run it again.

2
  • 3
    I'm using SSH to connect to a Macos, how can I do what you said through the command line ?
    – SebMa
    Commented Sep 26, 2017 at 16:42
  • Very late but got the command. sudo xcodebuild -license accept
    – CuriousS
    Commented Jan 21 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.