首页 > 解决方案 > 编译C编译器识别源文件“CMakeCCompilerId.c”失败。编译器:/Applications/Xcode.app/......./usr/bin/cc

问题描述

我是 macOS 终端的新手。我正在尝试在我的 macOS(Big Sur 11.5.2)上使用 CMake(版本 3.21.2)。我已经安装了 XCode(版本 12.5.1)并安装了必要的使用说明如何从命令行更新 Xcode。在我看来,安装看起来很成功,但是,在使用 CMake 时,在CMakeError.log. 有谁知道发生了什么?

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

标签: xcodecmaketerminalidemacos-big-sur

解决方案


推荐阅读