epub file error in objective c
Asked Answered
D

1

6

I am new to iPad developer and i want to create ePub file in my project,

I downloaded sample epub file, from here and im stuck with a problem.

i am getting this errors in my project...

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)

How to solve this errors, any idea ?

Thanks In Advance !!

Drawback answered 7/2, 2012 at 9:51 Comment(11)
Please post some of your code where these errors are generated, it might help us understand your problem betterLycaon
i directly downloaded project from link above, and i run it in the simulator and i got above errors in my Log file...Drawback
do i need to add any library or any content in my project ?Drawback
Build your project for your device, not for the simulator. Looks like the library doesn't have an i386 build in it.Wo
@Nick Bull: i am not sure but i think it is not a problem of simulatorDrawback
do i need to add any html page or any library ?Drawback
Have you tried building it for the device?Wo
no... i directly tried in simulator.. how it will run in device ? bcoz my program itself shows error.. m not able to see outputDrawback
The problems seem to be coming from the libz.1.2.3.dylib framework. In your project, click on your target and go to the Build Phases tab, then "Link binary with libraries" section, and try removing the libz.1.2.3.dylib and then re-adding the libz.1.2.5 (if you are using the latest iOS SDK)Lycaon
If your library doesn't contain the i386 code, then it won't work on the simulator. It might only contain the arm6/7 code needed for running on the device.Wo
@NickBull: thank you so much... it works properly when i add libz.1.2.5Drawback
L
12

The logs seem to indicate that the problem is coming from the libz.1.2.3.dylib framework.

What iOS SDK are you using (and which Xcode version) ?

In your project, click on your target and go to the Build Phases tab, then "Link binary with libraries" section.

Try removing the libz.1.2.3 framework and then re-adding the libz.1.2.5 (click on the little "+" at the bottom of the window and select libz.1.2.5 from the list).

EDIT:

As stated by Abizern in below comment, adding libz.dylib instead of libz.1.2.5.dylib should do the trick. This should link to the latest version of the lib (see this question and answers here).

Lycaon answered 7/2, 2012 at 12:13 Comment(2)
It's easier to just add the libz framework rather than worry about the particular version. It's that sort of thing that caused such errors in the first place.Coiffeur
You're welcome :) Check my edit following Abizern's comment, it should prevent you from getting similar errors in the futureLycaon

© 2022 - 2024 — McMap. All rights reserved.