首页 > 解决方案 > 自生成新的 xcodeproj 文件以来,项目中架构 x86_64 的新未定义符号

问题描述

我最近xcodeproj使用生成器工具(Xcode gen)为我的应用程序生成了一个新文件,我现在正在尝试编译该项目,但出现以下错误:

Undefined symbols for architecture x86_64:
  "MyProject.Package.isValid.setter : Swift.Bool", referenced from:
      key path setter for MyProject.Package.isValid : Swift.Bool : MyProject.Package in MultiplePlansViewModel.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

isValid bool是这样定义的:

private(set) lazy var isValid: Bool = paymentMethods.contains { $0.isValid }

奇怪的是,如果我将此代码更改为:

var isValid = false

然后项目编译。

任何想法为什么我现在收到此错误?设置新xcodeproj文件时我可能会错过一些编译器标志吗?

标签: swiftxcode

解决方案


推荐阅读