简体   繁体   中英

Apple Mach-O linker Error for libz.1.dylib framwork

Iam developing one application.In that i am using libz.1.dylib framework.And this application will be working fine in simulator.When i try to archive this application i got a error like Apple Mach-O linker error.And show the error like

/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/InstallationBuildProductsLocation/Applications/StudyApp.app/StudyApp normal armv7
cd /Users/wifin/Desktop/K.V.Naresh/SmartSvn/27-04-2012
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH "/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/BuildProductsPath/Release-iphoneos -F/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/BuildProductsPath/Release-iphoneos -filelist /Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/IntermediateBuildFilesPath/StudyApp.build/Release-iphoneos/StudyApp.build/Objects-normal/armv7/StudyApp.LinkFileList -dead_strip -fobjc-arc -miphoneos-version-min=3.0 -lz -lsqlite3.0 -framework AVFoundation -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/InstallationBuildProductsLocation/Applications/StudyApp.app/StudyApp

ld: library not found for -lz clang: error: linker command failed with exit code 1 (use -v to see invocation)

So please tell me how to solve this error.

EDIT: Check that each module and lib you expect to be in the build are actually in the build

See this SO answer and this answer also for more clang errors and what to try.

You should still link against libz as a matter of course:

Instead of linking against libz.1.dylib you need to link against libz.dylib

Remove the entry for libz.1.dylib from your linker settings and add libz.dylib manually

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM