这个问题快把我逼疯了,我不知道怎么解决它。

    Undefined symbols for architecture armv7:
  "_deflateEnd", referenced from:
      -[ASIDataCompressor closeStream] in ASIDataCompressor.o
  "_OBJC_CLASS_$_ASIDataDecompressor", referenced from:
      objc-class-ref in ASIHTTPRequest.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 armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

我认为这与:

ld: symbol(s) not found for architecture armv7

但是我添加了:libz.1.2.3。Dylib并没有帮助,有人有什么想法吗?


当前回答

我有这个警告,当在另一个类的.h文件中写两个类时,但忘记在.m文件中写这个类的实现。

其他回答

昨晚我遇到了一个类似的问题,这个问题与我在Xcode中从Finder拖拽一个类有关。

解决方案是选择Build Phases选项卡,然后选择Compile Sources,并确保将类拖到列表中。

我有这个警告,当在另一个类的.h文件中写两个类时,但忘记在.m文件中写这个类的实现。

下面是我是如何得到这个问题的:

我从另一个项目中添加了.h, .m和NIB,把它们拖到我的项目导航器上。Xcode没有正确地将它们添加到构建阶段。

检查我的答案,因为我有一个类似的问题,我可以通过做一些步骤来解决。

尝试实现派生类的至少一个非内联函数。如果不这样做,链接器可能会避免为该类创建类型信息。

If you're building from Unity3D 5 and also using a Prime31 plugin and you're getting this error it's probably due to a duplicate .dll. If you look through your warnings in Unity's editor one of them will tell you this and warn that it could cause build errors. To see if this is the case, type P31 in your project search field and it should pop right up, maybe even more than one. The duplicate's will have a ' 1' at the end of the file name. This is probably caused from updating the plugin in editor via the store or the Prime31 menu tab.