libz.1.dylib框架的Apple Mach-O链接器错误 [英] Apple Mach-O linker Error for libz.1.dylib framwork
问题描述
我正在开发一个应用程序,因为我使用的是libz.1.dylib框架.该应用程序在模拟器中可以正常工作.当我尝试对该应用程序进行存档时,我遇到了类似Apple Mach-O linker error的错误.显示类似
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:找不到-lz的库clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
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.
推荐答案
检查您希望包含在构建中的每个模块和lib实际上都在构建中
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.
当然,您仍然应该链接到libz:
You should still link against libz as a matter of course:
您需要链接到libz.dylib而不是链接到libz.1.dylib
Instead of linking against libz.1.dylib you need to link against libz.dylib
从链接器设置中删除libz.1.dylib的条目,然后手动添加libz.dylib
Remove the entry for libz.1.dylib from your linker settings and add libz.dylib manually
这篇关于libz.1.dylib框架的Apple Mach-O链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!