8

I'm attempting to add ZipArchive to my project following the WikiPage. I've added it to my project and attempted to build, but now NSObjRuntime.h, NSObject.h and countless other header files are all having parsing issues!

I've included a screenshot of my workspace

workspace

and the errors...

errors

Some more details about the project.

  • Building against iOS5.
  • Using ARC.
DavidAndroidDev
  • 2,371
  • 3
  • 25
  • 41

4 Answers4

6

So I finally got it figured out. Instead of adding groups and then adding the files to those groups, I dragged and dropped the ZipArchive folder into the project. In the dialog that pops up...I chose the "Create folder references for any added folders".

Copy image

This gave me BLUE folders within my workspace, and everything compiles fine now.

Blue folders

Though, now I need to figure out the difference between folder references and group references.

DavidAndroidDev
  • 2,371
  • 3
  • 25
  • 41
  • This allowed my project to compile. but now I cannot add #import "ZipArchive.h" it says file not found. – The Lazy Coder Jun 29 '12 at 02:32
  • Nevermind. I know what the difference between Folder and Group is. I had to put #import "Encoding/ZipArchive/ZipArchive.h" as the folder I added was in the Encoding folder in my project. And that folder is relative to the place my file was added. – The Lazy Coder Jun 29 '12 at 02:35
5

The solution we found is to change the File Type for all .c file in folder minizip from C-Source to Objective-C source in the Identity and Type tab on the right-side.

It works for us.

Good luck

Magnus
  • 173
  • 2
  • 7
4

The issue is probably caused by Objective-C in your C files. This could be caused by imports in your PCH. You need to wrap these in a #ifdef __OBJC__

i.e.

#ifdef __OBJC__
#import "SomeObjecitveCFile.h"
#endif
hypercrypt
  • 15,389
  • 6
  • 48
  • 59
1

Dragging and dropping the ZipArchive folder into the project did not work for me. Instead, I dragged and dropped the minizip folder into the same folder where I added ZipArchive.h and ZipArchive.m files seperately. I chose the "Create folder references for any added folders". Reason: In ZipArchive.h file we do

 #include "minizip/zip.h"
 #import "AppDelegate.h"
 #include "minizip/unzip.h"
Amit
  • 61
  • 1
  • 7