Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding minizip breaks Objective-C

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.
like image 864
DavidAndroidDev Avatar asked Feb 22 '12 16:02

DavidAndroidDev


3 Answers

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.

like image 164
DavidAndroidDev Avatar answered Nov 11 '22 01:11

DavidAndroidDev


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

like image 5
Magnus Avatar answered Nov 11 '22 00:11

Magnus


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
like image 4
hypercrypt Avatar answered Nov 11 '22 02:11

hypercrypt