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 !!

Krunal
  • 6,266
  • 20
  • 89
  • 154
  • Please post some of your code where these errors are generated, it might help us understand your problem better – Mutix Feb 07 '12 at 10:00
  • i directly downloaded project from link above, and i run it in the simulator and i got above errors in my Log file... – Krunal Feb 07 '12 at 10:08
  • do i need to add any library or any content in my project ? – Krunal Feb 07 '12 at 10:10
  • Build your project for your device, not for the simulator. Looks like the library doesn't have an i386 build in it. – Nick Bull Feb 07 '12 at 11:15
  • @Nick Bull: i am not sure but i think it is not a problem of simulator – Krunal Feb 07 '12 at 11:21
  • do i need to add any html page or any library ? – Krunal Feb 07 '12 at 11:21
  • Have you tried building it for the device? – Nick Bull Feb 07 '12 at 11:39
  • no... i directly tried in simulator.. how it will run in device ? bcoz my program itself shows error.. m not able to see output – Krunal Feb 07 '12 at 11:49
  • 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) – Mutix Feb 07 '12 at 12:06
  • 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. – Nick Bull Feb 07 '12 at 12:12
  • @NickBull: thank you so much... it works properly when i add libz.1.2.5 – Krunal Feb 07 '12 at 12:25

1 Answers1

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).

Community
  • 1
  • 1
Mutix
  • 4,206
  • 1
  • 25
  • 39
  • 3
    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. – Abizern Feb 07 '12 at 12:18
  • You're welcome :) Check my edit following Abizern's comment, it should prevent you from getting similar errors in the future – Mutix Feb 07 '12 at 12:25