Undefined symbols for i386 architecture: "_OBJC_CLASS _ $ _ ZipException" referenced: error

I use several ".o" files in my project, and when compiling it shows the following error:

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

I posted the error log below

 Ld /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator/app.app/app normal i386 cd /Users/deepak/Workspace/iosDevelopement/PROJECTS/KML/app setenv IPHONEOS_DEPLOYMENT_TARGET 4.3 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator -F/Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator -F/Users/deepak/Workspace/iosDevelopement/PROJECTS/KML/app -filelist /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/Objects-normal/i386/app.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=4.3 -lstdc++ -licucore -lz -framework MapKit -framework CoreLocation -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework KML -o /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator/app.app/app Undefined symbols for architecture i386: "_OBJC_CLASS_$_ZipException", referenced from: objc-class-ref in ZipFile.o objc-class-ref in ZipReadStream.o objc-class-ref in ZipWriteStream.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Initially, there were more errors and they were resolved by importing the libs.dylib framework,

but 2 errors still persist.

EDIT: I already covered the popular Undefined character question for i386 architecture: _OBJC_CLASS _ $ _ SKPSMTPMessage "referenced: error , but the solution doesn't for me

Does anyone know where I was wrong? Am I having a problem with xcode, any missing libraries, or crashing when linking something?

Thank you in advance

+4
source share
2 answers

The error message says that the undefined character is referenced by ZipFile.o , ZipReadStream.o and ZipWriteStream.o . This means that you are trying to use Objective-Zip in your application.

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

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

The most likely explanation is that you simply did not include ZipException.m in your target. Make sure you do it. If you do not know how, check out this answer .

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

+38
source

The solution I provide will sound weird, and it took me a while to actually try it, but it helped. This is only true if you fixed the problem with binding the entire structure. Which was for me, but I was still left with a few Mach-O errors.

What I did was to remove all the libraries from the associated frameworks and libraries (in the General tab of iOSTarget), and then add them back by simply dragging them from the left pane into the linked frames and library space.

0
source

All Articles