Apple Mach-O链接器libz.1.dylib框架的错误

时间:2012-05-08 10:46:32

标签: iphone objective-c ios

我正在开发一个应用程序。我正在使用libz.1.dylib框架。这个应用程序将在模拟器中正常工作。当我尝试存档此应用程序时,我得到一个错误,如Apple Mach-O链接器错误。并且显示错误,如

/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查看调用)

所以请告诉我如何解决这个错误。

1 个答案:

答案 0 :(得分:2)

编辑:检查您希望构建中的每个模块和库是否实际上都在构建

请参阅this SO回答和this回答,了解更多铿锵错误以及尝试的内容。

你仍然应该链接libz:

您需要链接libz.dylib

,而不是链接libz.1.dylib

从链接器设置中删除libz.1.dylib的条目,并手动添加libz.dylib

enter image description here