IOS:图书馆没有找到-lz.1.2.3

问题描述:

我不明白我的错误:IOS:图书馆没有找到-lz.1.2.3

Ld Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test normal i386

cd /Users/lol/Desktop/Test 

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/llvm-gcc-4.2 

-arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk

-L/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator

-L/Users/lol/Desktop/Test -F/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator

-filelist /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList

-mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -lextThree20JSON+SBJSON /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UICommon.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UINavigator.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Core.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UI.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Network.a

/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Style.a

-framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework QuartzCore -framework UIKit -framework Foundation -framework MessageUI -framework CoreGraphics -lz.1.2.3 -lxml2.2.7.3 -o /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test

ld: library not found for -lz.1.2.3 
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1 

你能帮我明白这一点?

非常感谢;)

选项-lz.1.2.3意味着编译器试图文件libz.1.2.3.a,libz.1.2.3.so,或libz进行链接。 1.2.3.dylib。它找不到任何这些变化,并因此而失败。

您可以尝试查找此文件的位置并将其包含在库包含路径中。

我的问题是你为什么要链接特定版本的z lib?通常,只需使用-lz或-llibz.dylib即可。你有选择特定版本的理由吗?当您使用未版本化的名称进行链接时会发生什么情况。

+1

是的,它是不是好zlib的版本。所以我只是添加好的版本,它的工作。谢谢 :) – david55

只需使用-lz,就不需要使用版本化链接。所以从框架中删除libz-1.2.3.tbd并添加libz.tbd。

  1. 在项目导航器中,选择您的项目。
  2. 请选择您的目标。
  3. 选择“Build Phases”选项卡。
  4. 打开“Link Binaries With Libraries”扩展器。
  5. 删除libz-1.2.3.tbd
  6. 单击+按钮。
  7. 添加libz.tbd

Import lib