我已经包括了 libz.1.2.3.dylib
插入代码后
ZipArchive* za = [[ZipArchive alloc] init];
编译时出错
"_OBJC_CLASS_$_ZipArchive", referenced from:
更新
根据http://code.google.com/p/ziparchive/wiki/PageName
我已将 ZipArchive 文件夹包含到项目中,以及框架 libz.1.2.3.dylib。
然后我尝试在 iPhone 上解压缩文件,但出现有关框架的错误。怎么解决呢?
Ld build/ePUBreader.build/Debug-iphoneos/ePUBreader.build/Objects-normal/armv7/ePUBreader normal armv7
cd /Users/ragopor/Desktop/ePUBreader
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -L/Users/ragopor/Desktop/ePUBreader/build/Debug-iphoneos -F/Users/ragopor/Desktop/ePUBreader/build/Debug-iphoneos -filelist /Users/ragopor/Desktop/ePUBreader/build/ePUBreader.build/Debug-iphoneos/ePUBreader.build/Objects-normal/armv7/ePUBreader.LinkFileList -dead_strip -miphoneos-version-min=4.0 -framework Foundation -framework UIKit -framework CoreGraphics -framework StoreKit -lz.1.2.3 -o /Users/ragopor/Desktop/ePUBreader/build/ePUBreader.build/Debug-iphoneos/ePUBreader.build/Objects-normal/armv7/ePUBreader
Undefined symbols:
"_OBJC_CLASS_$_ZipArchive", referenced from:
objc-class-ref-to-ZipArchive in ePUBreaderAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
最佳答案
然后只需将 ZipArchive 文件夹拖放到 xCode“Classes”中即可。
然后添加框架libz.1.2.3.dylib。
就是这样。我的代码编译没有任何问题。
关于iphone - ZipArchive 库编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3528316/