2013-12-19 95 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路徑設置爲靜態路徑多個