Undefined symbols for architecture i386: “_OBJC_CLASS_$_ZipException”, referenced from: error

前端 未结 2 1873
不思量自难忘°
不思量自难忘° 2020-12-01 17:34

I\'m using a few \'.o\' files in my project and while compiling it shows the following error,

error:linker command failed with exit code 1 (use -v to see inv         


        
相关标签:
2条回答
  • 2020-12-01 18:05

    The solution I am providing will sound odd and it took a while for me to actually try it but it did the trick for me. This is only valid if you fixed all framework linking issue. Which was the case for me but I was still left with few Mach-O errors.

    What I did was to remove all libraries from the linked frameworks and libraries (in General tab iOSTarget) and then added them back by just dragging them from the left pane to the linked frameworks and library space.

    0 讨论(0)
  • 2020-12-01 18:20

    The error message says that the undefined symbol is referenced by ZipFile.o, ZipReadStream.o, and ZipWriteStream.o. This implies that you're trying to use the Objective-Zip library in your app.

    The undefined symbol is _OBJC_CLASS_$_ZipException. The compiler generates this symbol when it sees the @implemention ZipException directive in a source file.

    The Objective-Zip library includes a file named ZipException.m, which contains the @implementation ZipException directive.

    The most likely explanation is that you simply haven't included ZipException.m in your target. Check that you have done so. If you don't know how, look at this answer.

    Another possible explanation is that you have modified the ZipException.m file, perhaps accidentally, in a way that removes the @implementation ZipException directive or hides it from the compiler. Check that you have not modified the file, and that it contains the @implementation ZipException directive.

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