ld: unsupported tapi file type '!tapi-tbd' in YAML file
CMake Error at /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"/Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/tools/clang/runtime/compiler-rt-bins/CMakeFiles/CMakeScratch/TryCompile-BsCvNH'
Run Build Command(s): /opt/anaconda3/bin/ninja -v cmTC_bca1e
[1/2][ 50%][0.694s] /Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -mmacosx-version-min=13.0 -MD -MT CMakeFiles/cmTC_bca1e.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_bca1e.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_bca1e.dir/testCCompiler.c.o -c /Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/tools/clang/runtime/compiler-rt-bins/CMakeFiles/CMakeScratch/TryCompile-BsCvNH/testCCompiler.c
[2/2][100%][2.376s] : && /Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -mmacosx-version-min=13.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/icu4c/lib CMakeFiles/cmTC_bca1e.dir/testCCompiler.c.o -o cmTC_bca1e && :
FAILED: cmTC_bca1e
: && /Users/helinyu/workspace/GitHub/space_swift/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -mmacosx-version-min=13.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/icu4c/lib CMakeFiles/cmTC_bca1e.dir/testCCompiler.c.o -o cmTC_bca1e && :
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
遇到 ld: unsupported tapi file type '!tapi-tbd' 错误通常是由于与链接器(ld)或 Xcode SDK 相关的问题。以下是一些解决该问题的步骤和建议:
0. 很可能安装了conda —— 我的就是这个原因
暂时先去掉conda的 环境,很坑你conda的内容和xcode的工具冲突了
1. 更新 Xcode 和 Command Line Tools
确保你的 Xcode 和 Command Line Tools 是最新版本。可以通过 Mac App Store 更新 Xcode,使用以下命令更新 Command Line Tools: