如何解决在XCode 4项目中编译ZipArchive
| 我正在尝试用我的项目编译ZipArchive。我导入了所有源文件,包括minizip文件,我不知所措以了解这些错误。我尝试了其他十多种方法将压缩/解压缩合并到我的iphone项目中,但都没有成功。 ZipArchive似乎是最好的库,这个问题似乎是一个简单的构建设置配置问题,但我无法弄清楚。Undefined symbols for architecture armv6:
\"_zipClose\",referenced from:
-[ZipArchive CloseZipFile2] in ZipArchive.o
\"_zipOpenNewFileInZip3\",referenced from:
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
\"_unzOpenCurrentFile\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_unzGetGlobalInfo\",referenced from:
-[ZipArchive UnzipOpenFile:] in ZipArchive.o
\"_unzReadCurrentFile\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_unzOpen\",referenced from:
-[ZipArchive UnzipOpenFile:] in ZipArchive.o
\"_unzCloseCurrentFile\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_zipWriteInFileInZip\",referenced from:
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
\"_zipOpenNewFileInZip\",referenced from:
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
\"_unzGoToFirstFile\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_unzGetCurrentFileInfo\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_zipCloseFileInZip\",referenced from:
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
\"_unzClose\",referenced from:
-[ZipArchive UnzipCloseFile] in ZipArchive.o
\"_zipOpen\",referenced from:
-[ZipArchive CreateZipFile2:] in ZipArchive.o
\"_unzGoToNextFile\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
\"_unzOpenCurrentFilePassword\",referenced from:
-[ZipArchive UnzipFileTo:overWrite:] in ZipArchive.o
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
解决方法
我有完全一样的问题。我将Xcode 4.4用于iOS 5.1。
我这样解决了:
删除所有的ZipArchive-files incl。项目中的Minizip文件夹-移至废纸.。
重新添加ZipArchive-Files和Minitip-Folder,并确保选择选项\“为任何添加的文件夹创建组\”,而不是\“为任何添加的文件夹创建文件夹引用\”。
如果使用ARC,则将“ \ -fno-objc-arc \”选项添加到所有“构建阶段”->“编译源ZipArchive-Items”
就是这样-祝你好运。
,当我尝试时,它会很容易地通过以下链接进行编译
http://code.google.com/p/ziparchive/wiki/PageName
我只是按照以下表格拿文件夹
ZipArchive
ZipArchive.h
ZipArchive.mm
minizip (Folder)
然后只需将ZipArchive文件夹拖放到xCode \“ Classes \”中即可。
然后添加框架libz.1.2.3.dylib。
而已。我的代码可以编译而没有任何问题。
,通过在项目设置的目标部分的“其他链接标志”中添加\“ / usr / lib / libz.dylib \”,使它起作用。
Minizip对我有用。
,我也陷入了同样的情况。
但是我找到了以下解决方案。
http://travitu.hatenablog.jp/entry/2014/12/23/005037
我是这样解决的:
・将ZipArchive-Files和Minitip-Folder添加到项目中时,
您应该选中“复制所需的项目”和“创建组”。
就这样。
,我通过添加libz.tdb文件来使其工作。 (Xcode 7,iOS 9)。错误消失了。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。