在 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
I'm trying to compile ZipArchive with my project. I imported all the source files, including the minizip files and I am at a loss to understand these errors. I've tried a dozen other ways to incorporate compression/decompression into my iphone project, all with out success. ZipArchive seems to be the best library out, and this problem looks like it's a simple build settings configuration problem but I cannot figure it out.
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我有完全相同的问题。我在 iOS 5.1 上使用 Xcode 4.4。
我这样解决了这个问题:
就是这样 - 祝你好运。
I had exactly the same issue. I use Xcode 4.4 for iOS 5.1.
And I solved it this way:
That´s it - good luck.
当我尝试时,可以使用以下链接轻松编译它
http://code.google.com/p /ziparchive/wiki/PageName
我只是将文件夹放入以下表单中
,然后将其拖动到 /ziparchive/wiki/PageName将 ZipArchive 文件夹放入 xCode“Classes”中。
然后添加框架libz.1.2.3.dylib。
就是这样。我的代码编译没有任何问题。
When I tried it will easily compiled with following link
http://code.google.com/p/ziparchive/wiki/PageName
I just take folder in following Form
Then just drag & drop ZipArchive folder in to xCode "Classes".
Then add framework libz.1.2.3.dylib.
That's it. My code get compile without any issue.
我通过将“/usr/lib/libz.dylib”添加到项目设置的目标部分中的其他链接标志来使其工作。
它对我来说对 Minizip 很有用。
I got it working by adding "/usr/lib/libz.dylib" to the Other Link Flags in the targets section of Project settings.
It worked for me with Minizip.
我也遇到了同样的情况......
但我找到了以下解决方案。
http://travitu.hatenablog.jp/entry/2014/12/23/005037
我是这样解决的:
·当你将 ZipArchive-Files 和 Minitip-Folder 添加到你的项目中时,
您应该选中“如果需要,复制项目”和“创建组”。
就这样。
I also fell into this same case....
But I found the following resolution.
http://travitu.hatenablog.jp/entry/2014/12/23/005037
I solved it this way:
・When you add ZipArchive-Files and the Minitip-Folder to your project,
you should check "Copy items if needed" and "Create groups".
That's all.
我通过添加 libz.tdb 文件来实现此功能。 (Xcode 7、iOS 9)。错误消失了。
I got this working by adding libz.tdb file. (Xcode 7, iOS 9). Error gone.