Mac OS Sierra:检查C编译器是否工作...否 [英] Mac OS Sierra: checking whether the C compiler works... no

查看:106
本文介绍了Mac OS Sierra:检查C编译器是否工作...否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在MacOS Sierra系统上编译一个C库,但是出现以下错误:

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

我尝试按照我尝试设置CC路径并按照 https://中的说明安装xcode apple.stackexchange.com/questions/216573/cant-compile-source-code-on-mac :

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

并接受许可.但是没有任何效果.在Sierra上是否有任何新的步骤可以考虑以使命令行工具正常运行?

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

推荐答案

启动Xcode,选择首选项",然后选择位置".您会在命令行工具"中注意到一个下拉控件.选择最新版本,关闭对话框窗口,然后再次调用brew.重新启动计算机,然后再次运行.

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.

这篇关于Mac OS Sierra:检查C编译器是否工作...否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆