Front-end
Apple
Apple
  • 第三方库
    • RAC库
      • ReactiveObjc
        • 如何实现的
        • 有关类
        • 有关协议
        • 关键概念列表
          • RACSignal有关类
            • RACStream
              • 头文件定义
            • RACSignal
              • 头文件定义内容
              • 核心代码
              • 常用的方法
                • concat:
                • bind:
                • zipWith 和merge
            • RACSubject
              • 内容
            • RACReplaySubject
              • 内容
            • RACBehaviorSubject
              • 内容
            • RACGroupedSignal
              • 内容
            • RACDynamicSignal
              • RACDynamicSignal
              • RACSignal vs RACDynamicSignal
            • RACReturnSignal
              • 内容
            • RACErrorSignal
            • RACEmptySignal
            • RACChannelTerminal
            • 疑问
              • RACChannelTerminal vs RACSubject
              • RACSignal vs RACStream
              • 热信号和冷信号
                • 进一步理解
              • 信号的发送者和接受者
                • RACSignal 不是信号对象么?为什么信号的发送者是自己呢?
          • RACChannel有关类
            • RACChannel
              • Page 1
              • 用于MVVM架构
              • RAC() vs RACChannelTo()
            • RACKVOChannel
              • 内容
              • 封装了系统的KVO
          • RACCommand
          • RACSubscriber
          • RACTuple
          • RACSequence有关类
          • RACKVOTrampoline
            • NSObject+RACKVOWrapper.h
            • NSObject+RACKVOWrapper.m
          • Page
          • 宏
          • 疑问
            • RACCommand vs RACSignal
            • 有了信号量,为什么还需要RACCommand
        • 操作方法
          • reduce
            • reduce 在不同语言以及库中是否一样的概念?
      • ReactiveSwift
        • 相比ReactiveObjc
      • RxSwift
      • Combine
      • 疑问
        • 热信号 vs 冷信号
        • ReactiveObjC 和 ReactiveSwift 实现原理差异
        • ReactiveObjC、ReactiveCocoa、ReactiveSwift的关系与区别
        • ReactiveObjC、ReactiveCocoa、ReactiveSwift内容
        • ReactiveSwift vs RxSwift
        • RxSwift、ReactiveSwift 和 ReactiveObjC
        • RxSwift、ReactiveSwift 、Combine
    • swift源码
      • 编译
        • 命令参数解释
        • 涉及到的工具
          • cmake 和 ninja
          • sccache
        • Rosetta模式
        • 遇到问题
          • FETCH_HEAD': Permission denied
          • --local_compiler_build': No such file or directory
          • ld: unsupported tapi file type '!tapi-tbd' in YAML file
          • python --version 显示没有这个命令
          • ModuleNotFoundError: No module named 'packaging'
          • ModuleNotFoundError: No module named 'sphinx'
            • sphinx是什么
          • ERROR: Could not find a version that satisfies the requirement sphinx (from versions: none)
          • /Applications/Python\ 3.x/Install\ Certificates.command 失败
          • 已经安装了sphinx,还是显示错误
      • 涉及到的知识点
        • Swift中的MCCAS
Powered by GitBook
On this page
  1. 第三方库
  2. swift源码
  3. 编译
  4. 遇到问题

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:

xcode-select --install

2. 检查 Xcode 的命令行工具路径

确保 Xcode 的命令行工具路径是正确的。可以通过以下命令查看和设置:

xcode-select -p

如果路径不正确,可以使用以下命令设置:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

3. 确保 SDK 文件有效

检查 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ 目录下的 SDK 文件。确保 MacOSX15.0.sdk 存在并且没有损坏。可以尝试重新安装 Xcode 或恢复 SDK 文件。

4. 清理构建缓存

清理构建缓存可能会解决问题。你可以尝试以下步骤:

# 清理 CMake 缓存
rm -rf CMakeCache.txt CMakeFiles/
# 清理构建目录
rm -rf /Users/helinyu/workspace/GitHub/space_swift/build

5. 使用不同的 SDK 版本

如果问题依然存在,考虑使用不同版本的 SDK。可以在终端中查看已安装的 SDK:

xcodebuild -showsdks

如果有其他版本的 macOS SDK(如 MacOSX14.0.sdk),可以在 CMake 配置中指定使用不同的 SDK:

cmake -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk ..

6. 使用其他构建工具

如果问题仍然存在,可以尝试使用其他构建工具,如 make 或 ninja。例如,使用 ninja 时,可以在 CMake 中指定:

cmake -G Ninja ..

7. 检查环境变量

确保没有其他环境变量(如 CC 和 CXX)影响编译过程。可以通过以下命令检查:

echo $CC
echo $CXX

如果有设置,尝试取消它们并重新运行 CMake。

Previous--local_compiler_build': No such file or directoryNextpython --version 显示没有这个命令

Last updated 8 months ago