【发布时间】:2017-03-22 05:40:35
【问题描述】:
我想在我的 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/XcodeDefault.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 上是否有任何新的步骤需要考虑以使命令行工具正常运行?
【问题讨论】:
标签: c xcode macos gcc macos-sierra