2

我有一个 .m 文件,其中包含一些常量,我试图将其包含在 podspec 的源文件中:

s.source_files  =     'GBToolbox/GBConstants_Common.{h,m}',
                      ...

但是在构建应用程序时,我得到一个未找到符号的错误:

Undefined symbols for architecture i386:
  "_kSomeConst", referenced from:
      _DataForObject in APIProxy.o
      ...

源文件的样子,标题:

//GBConstants_Common.m

extern NSUInteger const kSomeConstant;

执行:

//GBConstants_Common.m

#import "GBConstants_Common.h"

NSUInteger const kSomeConstant = 42;

有什么想法可能导致这种情况吗?

4

1 回答 1

1

一周前我遇到了同样的问题。您的 Pods 项目并没有编译所有必需的架构。看你的消息

Undefined symbols for architecture i386:

为了纠正这个:

  • 在 Build Setting 选项卡中选择您的 Pods 目标,检查“B​​uild Active Architectures only”是否必须全部设置为 NO
  • 基础 SDK 必须是 IOS(最新的 IOS (IOS 6.1)
  • 必须设置架构 $ARCHS_STANDARD_32_BIT(标准 armv7 armv7s)

必须在 Pods 项目中设置相同的值

于 2013-10-17T06:08:37.960 回答