Adding minizip breaks Objective-C

后端 未结 4 561
眼角桃花
眼角桃花 2021-01-12 03:17

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 countles

相关标签:
4条回答
  • 2021-01-12 03:46

    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.

    0 讨论(0)
  • 2021-01-12 03:47

    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
    
    0 讨论(0)
  • 2021-01-12 03:48

    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"
    
    0 讨论(0)
  • 2021-01-12 04:00

    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

    0 讨论(0)
提交回复
热议问题