2013-12-19 78 views
-1

我已经下载了附在我的邮件中的源代码。有一个名为'libiphone-exif.a'的静态库,它不起作用&显示错误。于是我下载了该库从code.google.com &添加它通过“链接二进制与图书馆”,但现在我不能建立这个&它显示了以下错误:静态库'libiphone-exif.a'的链接器命令失败错误

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) 
+0

文件已被添加多次。 –

+0

请检查此: - http://stackoverflow.com/questions/10435213/linker-command-failed-with-exit-code-1-use-v-to-see-invocation –

+0

请参阅一次是否导入了'PictureViewController.m '代替'PictureViewController.h' –

回答

1

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

1)推出-的iPhoneOS,

2)推出的模拟器-iphonesimulator

所以当您在模拟器(i386体系结构)中运行它时,请使用Release-simulator-iphonesimulator文件夹中的.a文件,并在设备上使用Release-iphoneos中的.a文件。

试着做到这一点,让我知道你是否有任何错误。

创建通用库,然后再试一次,

  • 打开终端
  • cd到你的iPhone-EX的下载文件夹
  • 脂-arch i386发行版本的模拟器,iphonesimulator/libiphone-exif.a -arch armv6 release-iphoneos/libiphone-exif.a -create -output libiphone-exif-universal.a

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

+0

我做了这个bro,但又出现了同样的错误! – Leo

+0

查看编辑的评论。 –

0

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