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

    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文件中有多个@接口,还没有包括所有相应的@实现指令。确保它们都平衡了。

其他回答

在我的例子中,我添加了一个必须使用Objective c++的框架。我找到了这个帖子:

XCode .m vs. mm

这说明了主要的。M需要重命名为main。mm,这样objective - c++类也可以被编译。

这为我解决了问题。

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.

我还通过拖放添加了文件。我所做的,我删除了所有文件的引用(不包括框架),然后通过添加文件到项目选项正确地添加它们,问题消失了。

当我加入第三方框架时,我也遇到了同样的问题。

当我从目标的构建设置中的有效架构条目中删除armv7s时,问题得到了解决,它开始工作。

回到你的项目,点击Build phases, Compile sources, Add GameCenterManager。M到列表上。