Mac OS Sierra: checking whether the C compiler works… no

老子叫甜甜 提交于 2020-05-25 07:21:51

问题


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:


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.



来源:https://stackoverflow.com/questions/40489574/mac-os-sierra-checking-whether-the-c-compiler-works-no

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!