HardBirch

XCode4.2 SDK5 中缺少libz.1.2.X.dylib的错误

时间:12-08-15 栏目:iOS移动应用开发技术 作者:张飞不张,文采横飞 评论:0 点击: 1,574 次

最近开发IOS,有的哥们用的是Xcode 3 ,有的用的Xcode4, 然而在check代码的时候总是遇到各种各样神奇的问题。昨天有一哥们check了代码,找不到libz.1.2.3.dylib包,整得死去活来,不过还好有强大的google, baidu ,顺利解决。

先看一下错误是哪一些吧:

ld: library not found for -lz.1.2.3
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
或是用了ASIHttpRequest Framework:

 Undefined symbols for architecture  i386:
  "_crc32", referenced from:
      _unzReadCurrentFile in unzip.o
  "_inflateEnd", referenced from:
      _unzCloseCurrentFile in unzip.o
      -[ASIDataDecompressor closeStream] in ASIDataDecompressor.o
  "_inflate", referenced from:
      _unzReadCurrentFile in unzip.o
      -[ASIDataDecompressor uncompressBytes:length:error:] in ASIDataDecompressor.o
  "_deflateEnd", referenced from:
      -[ASIDataCompressor closeStream] in ASIDataCompressor.o
  "_get_crc_table", referenced from:
      _unzOpenCurrentFile3 in unzip.o
  "_inflateInit2_", referenced from:
      _unzOpenCurrentFile3 in unzip.o
      -[ASIDataDecompressor setupStream] in ASIDataDecompressor.o
  "_deflate", referenced from:
      -[ASIDataCompressor compressBytes:length:error:shouldFinish:] in ASIDataCompressor.o
  "_deflateInit2_", referenced from:
      -[ASIDataCompressor setupStream] in ASIDataCompressor.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

原因:

libz.1.2.3.dylib到了ios5上面就变成libz.1.2.5.dylib

 

下面说两种方法,看官可一一尝试一下:

1。你可以通过连接把libz.1.2.3 连接到 libz.1.2.5

命令如下:

<span style="white-space:pre">	</span>sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libz.1.2.3.dylib /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libz.1.2.5.dylib

这样工程就不修改什么,别人check一下代码继续用,比较推荐这种办法

2. 直接在工程里面把libz.1.2.3删除掉,然后再把libz.1.2.5直接拖到项目中去。

声明: 本文由( 张飞不张,文采横飞 )原创编译,转载请保留链接: XCode4.2 SDK5 中缺少libz.1.2.X.dylib的错误

XCode4.2 SDK5 中缺少libz.1.2.X.dylib的错误:等您坐沙发呢!

发表评论


QQ群互动

Linux系统与内核学习群:194051772

WP建站技术学习交流群:194062106

魔豆之路QR

魔豆的Linux内核之路

魔豆的Linux内核之路

优秀工程师当看优秀书籍

优秀程序员,要看优秀书!

赞助商广告

友荐云推荐