静态库'libiphone-exif.a'的链接器命令失败错误



我已经下载了一个源代码,该源代码附在我的邮件中。有一个名为"libiphone-exif.a"的静态库无法正常工作并显示错误。然后我从 code.google.com 下载了该库并通过"将二进制文件与库链接"添加它,但现在我无法构建它,它显示以下错误:

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)

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

1) 发布-iphoneos,

2)发布模拟器

因此,当您在模拟器(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。

结帐你目标>构建设置-serch 路径是设置静态路径多个

最新更新