c - Mac OS Sierra : checking whether the C compiler works. .. 没有

标签 c xcode macos gcc macos-sierra

我想在我的 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 中的建议设置符号链接(symbolic link):

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

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

export CC=clang
xcode-select --install

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

最佳答案

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

关于c - Mac OS Sierra : checking whether the C compiler works. .. 没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40489574/

相关文章:

c - 与 int 'int ()' 的间接级别不同

c - 如何兼顾 FILE_SKIP_COMPLETION_PORT_ON_SUCCESS、IOCP 和清理

macos - 在 Yosemite 之前,Swift 屏幕保护程序可以在 Mac OS X 中运行吗?

css - 选择背景白色/透明 - Chrome OSx

c - 在 C 中编写宏时,如何找到参数的类型和 printf 说明符?

c - 在 Makefiles GCC C 程序中,什么是 .d 文件,什么是通配符?

iphone - 在 iPad 上选择图像

xcode - 使用 Cocoapods 时 Xcode 7.3 中的奇怪错误

ios - 我的 UIStackView 框架彼此堆叠

python - 并行作业不会在 scikit-learn 的 GridSearchCV 中完成