1

I'm creating a project that needs ZipArchive so I added the library and did everything needed in order for it to work but when i tried compiling the project i got this errors: enter image description here enter image description here

It is not a problem with the linker. I added everything needed and I just cant seem to get rid of the errors

Eli Braginskiy
  • 2,867
  • 5
  • 31
  • 46

2 Answers2

0

I have already seen these kinds of errors a million times when I was on Xcode 4.2. I bet you are on Xcode 4.2 right now when you compiled it.

If you want to use ZipArchive then upgrade your Xcode to latest 4.6 and all these errors will go away.

Sam B
  • 27,273
  • 15
  • 84
  • 121
  • I have latest version but I did get that error "Apple LLVM complier 4.2 error" how is this possible? , in project setting in compiler for c/c++/objective I have "default compiler (Apple LLVM compiler 4.2)" – Eli Braginskiy Jul 17 '13 at 09:37
0

This is an old thread, but this ZipArchive library is still useful.

From a similar question, the problem is as follows:

The compiler will try to import Objective-C frameworks into C source code. The minizip c files (zip.c, unzip.c, etc.) will thus try to import Objective-C frameworks as well.

To prevent this c files from importing Objective-C frameworks, wrap the entire .pch file like so:

#ifdef __OBJC__

// Your .pch contents

#endif

Credits: https://stackoverflow.com/a/13234930/1938889


However, there is a Cocoa pod that has addressed all these issues:

https://github.com/mattconnolly/ZipArchive

Zip archive processing for Cocoa - iPhone and OS X http://code.google.com/p/ziparchive/

Community
  • 1
  • 1
Drakes
  • 23,254
  • 3
  • 51
  • 94