加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Mac OS Sierra:检查C编译器是否正常工作……没有

发布时间:2020-12-14 17:47:35 所属栏目:百科 来源:网络整理
导读:我想在我的MacOS Sierra系统上编译一个C库,但是我收到以下错误: checking for a BSD-compatible install... /usr/local/bin/ginstall -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -
我想在我的MacOS Sierra系统上编译一个C库,但是我收到以下错误:

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

我尝试按照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

我尝试设置CC路径并安装xcode,如https://apple.stackexchange.com/questions/216573/cant-compile-source-code-on-mac所示:

export CC=clang
xcode-select --install

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

解决方法

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读