【问题标题】:missing required architecture i386 in file文件中缺少所需的体系结构 i386
【发布时间】:2011-07-29 12:50:31
【问题描述】:

添加 MapKit 和 CoreLocation 框架后,我无法构建我的应用程序。它们都是 4.3 框架,并且该应用程序过去可以与 UIKit、CoreGraphics 和 Foundation 一起正常工作,只是给我这两个框架带来了问题。不确定所需的架构是什么,代码中没有任何错误。任何帮助表示赞赏!

ld: warning: ignoring file /Users/F3d3r3r/Desktop/testNav4_3/MapKit.framework/MapKit, missing required architecture i386 in file

ld: warning: ignoring file /Users/F3d3r3r/Desktop/testNav4_3/CoreLocation.framework/CoreLocation, missing required architecture i386 in file

Undefined symbols for architecture i386:
  "_CLLocationCoordinate2DMake", referenced from:
       -[Layer2 tableView:cellForRowAtIndexPath:] in Layer2.o
  "_OBJC_CLASS_$_MKMapView", referenced from:
       objc-class-ref in Layer2.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

【问题讨论】:

标签: iphone mapkit core-location i386


【解决方案1】:

添加具有 CLLocation 和 MapKit 的 CoreLocation 框架。

【讨论】:

  • 我已经添加了 CoreLocation 和 MapKit。
  • @F3d3r3r 我还必须添加 MapKit :)
【解决方案2】:

我遇到了同样的问题..经过长时间的努力,我找到了问题..

我是这样解决的..

  1. 转到构建设置
  2. 搜索“框架搜索路径”
  3. 并删除预填充的路径。

现在它完美运行..希望它可以帮助一些人..

【讨论】:

  • 什么是“预填充路径”
  • @shim try $(PROJECT_DIR)/
【解决方案3】:

如果将框架从 Finder 复制到项目中,请务必小心。确保这件事;将“复制文件...”选项添加到项目时不会选中。

检查项目的根文件夹以及是否已复制它。删除它并尝试从头开始添加。

强烈推荐从 Xcode 的“Build Phases”添加“Link Binary With Libraries”部分。

【讨论】:

  • LTTP,但这应该是正确的答案。您可能复制了项目或其包含库的一部分,这搞砸了 xCode。对于其他进入这个线程的人,我会先试试这个。
【解决方案4】:

我在 Build Settings -> Search paths

中使用了 $(inherited)

参考以下 URL 了解 $(inherited) 的用法, What is $(inherited) in Xcode's search path settings?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-17
    • 2012-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-30
    • 2016-08-26
    相关资源
    最近更新 更多