目标c中的epub文件错误

Kru*_*nal 6 iphone epub ipad xcode4.2

我是iPad开发人员的新手,我想在我的项目中创建ePub文件,

我从这里下载了示例epub文件, 我遇到了问题.

我在我的项目中得到了这个错误......

ld: warning: ignoring file /Users/krunal/Downloads/EpubReader/libz.1.2.3.dylib, missing required architecture i386 in file
Undefined symbols for architecture i386:

"_inflateEnd", referenced from:
_unzCloseCurrentFile in unzip.o

"_inflateInit2_", referenced from:
_unzOpenCurrentFile3 in unzip.o

"_get_crc_table", referenced from:
_unzOpenCurrentFile3 in unzip.o
_zipOpenNewFileInZip3 in zip.o

"_crc32", referenced from:
_unzReadCurrentFile in unzip.o
_zipWriteInFileInZip in zip.o
-[ZipArchive addFileToZip:newname:] in ZipArchive.o

"_inflate", referenced from:
_unzReadCurrentFile in unzip.o

"_deflateInit2_", referenced from:
_zipOpenNewFileInZip3 in zip.o

"_deflate", referenced from:
_zipWriteInFileInZip in zip.o
_zipCloseFileInZipRaw in zip.o

"_deflateEnd", referenced from:
_zipCloseFileInZipRaw in zip.o

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

如何解决这个错误,任何想法?

提前致谢 !!

Mut*_*tix 12

日志似乎表明问题来自libz.1.2.3.dylib框架.

您使用的是什么iOS SDK(以及哪些Xcode版本)?

在项目中,单击目标并转到"构建阶段"选项卡,然后"将二进制文件链接到库"部分.

尝试删除libz.1.2.3框架,然后重新添加libz.1.2.5(单击窗口底部的小"+"并从列表中选择libz.1.2.5).

编辑:

正如Abizern在下面的评论中所述,添加libz.dylib而不是libz.1.2.5.dylib应该可以解决问题.这应该链接到lib的最新版本(见这个问题和答案在这里).

  • 只添加libz框架而不是担心特定版本更容易.就是那种首先导致这种错误的东西. (3认同)