Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone ZipArchive库编译错误_Iphone_Xcode - Fatal编程技术网

Iphone ZipArchive库编译错误

Iphone ZipArchive库编译错误,iphone,xcode,Iphone,Xcode,我包括 libz.1.2.3.dylib 插入代码后 ZipArchive* za = [[ZipArchive alloc] init]; 编译时出错 "_OBJC_CLASS_$_ZipArchive", referenced from: 更新 据 我已将ZipArchive文件夹包含到项目中,并已将框架libz.1.2.3.dylib包含到项目中 然后,我尝试在iphone上解压文件,但它显示了框架错误。如何解决 Ld build/ePUBreader.build/Debug-iph

我包括 libz.1.2.3.dylib

插入代码后

ZipArchive* za = [[ZipArchive alloc] init];
编译时出错

 "_OBJC_CLASS_$_ZipArchive", referenced from:
更新

我已将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不在libz.dylib中。ZipArchive应该从哪里来?它没有被编译或链接到你的应用程序。

你说你已将ZipArchive文件夹添加到项目中。根据您的描述,在编译项目期间似乎找到了头文件ZipArchive.h,但它没有编译包含ZipArchive类的ZipArchive.mm文件


文件扩展名.mm对我来说似乎很奇怪。这可能是文件未编译的原因。请尝试将其重命名为ZipArchive.m,然后重试。

我以前使用过此库,您需要在Xcode静态库中编译该库,然后将其包含在您的项目中,请参阅以下链接,它将对您有很大帮助


然后将ZipArchive文件夹拖放到xCode“Classes”中即可

然后添加框架libz.1.2.3.dylib


就这样。我的代码编译时没有任何问题。

将ZipArchive文件夹拖到项目中时,必须选择“为任何添加的文件夹创建组”,而不是“为任何添加的文件夹创建文件夹引用”。如果选择后者,链接器将出现未定义的符号错误。

我遇到了类似的问题。你能解决这个问题吗?.mm非常好,通常用在用Objective-C++编写的实现文件中。是的,但它似乎从未添加到项目中。