【问题标题】:Linker command failed error for static library 'libiphone-exif.a' [duplicate]静态库“libiphone-exif.a”的链接器命令失败错误 [重复]
【发布时间】:2013-12-19 06:50:15
【问题描述】:

我已经下载了一个源代码,它附在我的邮件中。有一个名为“libiphone-exif.a”的静态库无法正常工作并显示错误。然后我从 code.google.com 下载了该库并通过“Link Binary With Libraries”添加了它,但现在我无法构建它并且它显示以下错误:

ld: warning: ignoring file /Users/codemenmini2012-2/Downloads/iphone-exif-0-9/Release-    iphoneos/libiphone-exif.a, file was built for archive which is not the architecture being linked (i386): /Users/codemenmini2012-2/Downloads/iphone-exif-0-9/Release-iphoneos/libiphone-exif.a
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_EXFGPSLoc", referenced from:
  objc-class-ref in PictureViewController.o
"_OBJC_CLASS_$_EXFJpeg", referenced from:
  objc-class-ref in PictureViewController.o
"_OBJC_CLASS_$_EXFUtils", referenced from:
  objc-class-ref in PictureViewController.o
"_OBJC_CLASS_$_EXFraction", referenced from:
  objc-class-ref in PictureViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

  • 文件已添加多次。
  • 看看你是否导入了PictureViewController.m而不是PictureViewController.h
  • 显示i386架构(模拟器)的文件丢失,在设备上运行它可能会在设备上成功运行。
  • 你说的是静态库吗?

标签: ios iphone ios7 static-libraries


【解决方案1】:

我从下面的链接下载了库,并在其中找到了两个库文件夹, https://code.google.com/p/iphone-exif/downloads/list

1) 发布-iphoneos,

2) 发布-simulator-iphonesimulator

因此,当您在模拟器(i386 架构)中运行它时,请使用 Release-simulator-iphonesimulator 文件夹中的 .a 文件,而当您为设备运行它时,请使用 Release-iphoneos 中的 .a 文件。

尝试这样做,如果您遇到任何错误,请告诉我。

创建通用库并重试,

  • 打开终端
  • CD 到您的 iphone-ex 下载文件夹
  • lipo -arch i386 Release-simulator-iphonesimulator/libiphone-exif.a -arch armv6 Release-iphoneos/libiphone-exif.a -create -output libiphone-exif-universal.a

之后在您的项目中使用 libiphone-exif-universal.a。

【讨论】:

  • 我做了这个兄弟,但又出现同样的错误!
  • 检查编辑的评论。
【解决方案2】:

checkout you target->build setting -serch path 是设置静态路径的倍数

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-09
    • 2014-05-20
    • 2012-08-20
    • 2019-09-17
    • 2015-11-28
    • 2015-01-11
    相关资源
    最近更新 更多