如何解析体系结构i386的未定义符号

时间:2015-02-10 19:02:26

标签: ios xcode linker ld

我最近将一些来自git存储库的源代码下载到Xcode 6.1.1中。但是,我正在为一个包含在应用程序中的库(并且存在于我的文件系统中)“缺少必需的架构i386”。 这是错误:

ld: warning: ignoring file /Users/myname/Documents/mycomp-mycompapp-ios/mycomp/libs/zbar_iOS7_Fix/libzbar.a, missing required architecture i386 in file /Users/myname/Documents/mycomp-mycompapp-ios/mycomp/libs/zbar_iOS7_Fix/libzbar.a (3 slices)
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ZBarReaderView", referenced from:
      objc-class-ref in MyViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经完成了一些类似的帖子,但是我无法弄清楚解决方案是什么 - 它与构建设置有关,我是否导入了另一个库?

1 个答案:

答案 0 :(得分:1)

看起来Xcode没有在"构建阶段"中链接您的库。以下是修复它的步骤:

TargetSettings - >构建阶段 - >编译源 - >添加您的ZBarReaderView.m类(以及其他必要时) - >构建并运行