1

I'm trying to use Objective-Zip on an IOS5 iPhone application and I get the following linkage error when I build my project:

----------- ***********---------------

Ld /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator/Zarvaragh.app/Zarvaragh normal i386 cd /Users/amirpeivandi/Documents/iPhoenApps/Zarvaragh setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator -F/Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator -filelist /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Intermediates/Zarvaragh.build/Debug-iphonesimulator/Zarvaragh.build/Objects-normal/i386/Zarvaragh.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -lz -framework CoreGraphics -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework UIKit -framework Foundation -o /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator/Zarvaragh.app/Zarvaragh

Undefined symbols for architecture i386: "_OBJC_CLASS_$_ZipFile", referenced from: objc-class-ref in MainPageController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

----------- ***********---------------

I have no problem running the Objective-Zip application that comes with the code and I have checked my code, my project settings and all I could think of and the two projects (mine and default Objective-Zip iPhone project) have the same identical settings!

Any pointer would be greatly appreciated. I've been stuck for last couple of days on this silly thing. I've seen a few posts pointing to architecture supports and ARC setting but again I have two projects the way I see them identical one mine that is not compiling and one the one from Objective-Zip project that compiles and runs just fine!

Thx Amir

Amir Peivandi
  • 349
  • 4
  • 19
  • 1
    Looks like you're trying to run in on the simulator, but missing the library for that. Does it work/compile for a physical device? – picciano Feb 10 '12 at 15:59
  • Well as I said the other project works fine even in simulator. I did follow your suggestion and tried to run it on my device and I got almost the same error message: Undefined symbols for architecture armv7: "_OBJC_CLASS_$_ZipFile", referenced from: objc-class-ref in MainPageController.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) – Amir Peivandi Feb 10 '12 at 16:55

1 Answers1

1

Are you sure you have linked the Objective-Zip library in your project ? Because from the error it seems like it's not linked.

iDifferent
  • 2,190
  • 1
  • 14
  • 19
  • I've followed the example. Objective-Zip has no library, to use it you include the source files in your code which is what I've done and this is not a compile error, it's a linkage error. My code can be compiled fine and I get no errors in my source code. – Amir Peivandi Feb 10 '12 at 16:51
  • Are you using ARC in your project ? if so then I think that's the problem cause Objective-Zip doesn't support it, Try not using ARC and tell us what happens. http://code.google.com/p/objective-zip/issues/detail?id=10 – iDifferent Feb 10 '12 at 17:11
  • 1
    I resolved the issue. I explain here for others to avoid it. When adding Objective-Zip files to my project I didn't create group and simply add them as folders (don't even know what is the difference!) But that resulted in not having my Objective-zip files listed under the Build Phases/Compile Source section and therefore these files were not part of the build! I honestly still don't understand the issue but I deleted these files, add them again and this time chose "Create groups for any added folder" instead of "Create folder references for any added folder" and all is good!! – Amir Peivandi Feb 10 '12 at 17:57
  • i have the same problem, i added the three folders MiniZip,Objective-Zip and ZLib and i checked "Create groups for any added folder" when i add them, but i still have the liker error above !! – chostDevil May 04 '12 at 15:05