Undefined symbols for architecture armv7

2018-12-31 02:23发布

This problem has been driving me crazy, and I can't work out how to fix it...

    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

I think it has to do with:

ld: symbol(s) not found for architecture armv7

But I have added: libz.1.2.3.dylib and it's not helping, anyone got any ideas?

标签: ios armv7
30条回答
君临天下
2楼-- · 2018-12-31 02:51

I was facing an issue with PJSIP libraries,

Tried the following in other linker flags in project and able to resolve the error: -framework Foundation -framework UIKit

Above linker flags are used in Siphone Project over github. These settings will help you resolve problems related to linking of C++ libraries.

查看更多
有味是清欢
3楼-- · 2018-12-31 02:51

I had this issue, when installing shareKit. It worked in the simulator, but not on the device. I removed -all_load from the Other Linker Flag and everything works fine in both simulator and iphone device.

查看更多
梦寄多情
4楼-- · 2018-12-31 02:51

For me the problem was that i forget to set value for my constants in the .m (implementation)

file const kFooKey = @"Foo";
查看更多
听够珍惜
5楼-- · 2018-12-31 02:53

Finally i've figured it out, I solved this issue by adding absent framework to target->Build Phases->Link Binary With Libraries

查看更多
笑指拈花
6楼-- · 2018-12-31 02:55

Here's how I got this problem:

I added a .h, .m and NIB from another project by dragging them onto my project navigator. Xcode didn't add them to the Build Phases properly.

Check my answer because I had a similar problem that I was able to solve by doing some steps.

查看更多
明月照影归
7楼-- · 2018-12-31 02:55

I had the same problem. I tried every thing from the huge list of answer but in the end my problem was: I'm working with openCV so I need to combine C++ code in my code. To do this you should change the files which use objective-c and C++ to .mm I didn't changed one file and this file has no connection to the C++ code but I had to change it.

查看更多
登录 后发表回答