IOS:找不到-lz.1.2.3的库

时间:2012-05-03 14:35:04

标签: iphone ios llvm llvm-gcc

我不明白我的错误:

  

Ld的   图书馆/开发商/ Xcode中/ DerivedData /试验aywxyvnakaqhmwfbwellynwqmoik /编译/产品/调试-iphonesimulator / Test.app /测试   正常的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 /用户/笑/库/开发商/ Xcode中/ DerivedData /试验aywxyvnakaqhmwfbwellynwqmoik /编译/产品/调试-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 /笑/库/开发商/ Xcode中/ DerivedData /试验aywxyvnakaqhmwfbwellynwqmoik /编译/产品/调试-iphonesimulator / Test.app /测试

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

你能帮我理解一下吗?

非常感谢;)

2 个答案:

答案 0 :(得分: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 :(得分:0)

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

  1. 在项目导航器中,选择您的项目。
  2. 选择目标。
  3. 选择"构建阶段"标签。
  4. 打开"链接二进制文件与库"膨胀器。
  5. 删除libz-1.2.3.tbd
  6. 点击+按钮。
  7. 添加libz.tbd
  8. Import lib