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

    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并没有帮助,有人有什么想法吗?


当前回答

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.

其他回答

在我的例子中,当我在源代码控制下创建一个新分支时,我遇到了类似的问题。

我可以通过简单地执行产品>清洁来解决这个问题

我有类似的问题,并看到与“std::”相关的错误。

我改变了构建设置->苹果LVM 5.0 -语言c++ -> c++标准库

从libc++ (LLVM c++标准库与c++ 11支持) libstdc++ (GNU c++标准库)

我遇到了类似的问题,我必须在每个项目配置(调试、发布和部署)和目标的构建设置中检查“仅构建活动体系结构”。

别名通常不包含链接到当前版本的版本标识符,在本例中为libz。Dylib链接到libz.1.2.5.dylib。使用基本别名,而不是版本化的别名。

对我来说,问题是我忘记在.m(实现)中为我的常量设置值

file const kFooKey = @"Foo";