0

My app runs fine in the simulator, but I get the Undefined symbols for architecture armv7: errors when I run it on my device. I have all my certificates, provisioning profiles, etc. set up properly as I am able to launch other apps from Xcode on my iPod Touch. The iPod touch is 3rd generation running iOS5.1. Here are the errors specifically:

Undefined symbols for architecture armv7:
  "_inflate", referenced from:
      _comp_method_zlib_decomp in NMSSH(comp.o)
  "_deflate", referenced from:
      _comp_method_zlib_comp in NMSSH(comp.o)
  "_inflateEnd", referenced from:
      _comp_method_zlib_dtor in NMSSH(comp.o)
  "_deflateInit_", referenced from:
      _comp_method_zlib_init in NMSSH(comp.o)
  "_deflateEnd", referenced from:
      _comp_method_zlib_dtor in NMSSH(comp.o)
  "_inflateInit_", referenced from:
      _comp_method_zlib_init in NMSSH(comp.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As you can see, I'm using the NMSSH framework. Any help would be appreciated, thanks! ~Carpetfizz

EDIT: Just threw in libz.1.2.5.dylib and everything works perfectly!

Carpetfizz
  • 8,707
  • 22
  • 85
  • 146
  • 1
    FYI - You are not getting these errors when running the app. These are linker errors that happen near the end of building your app. – rmaddy Jul 10 '13 at 05:38
  • You can check out the answer from [link][1] [1]: http://stackoverflow.com/questions/18286150/linker-errors-when-trying-to-install-new-google-analytics-3-0-beta – Zahur Nov 12 '13 at 07:13

1 Answers1

5

Try including a libz. May be it will help in getting these runtime linker errors go away. or you need to specify the linker flag in build settings.

Jassi
  • 537
  • 8
  • 21
  • Thanks, I already have a libz actually. How do I specify a linker flag, and what does it do? Btw, here is a screenshot of all my links:http://i.imgur.com/yiqgDwP.png – Carpetfizz Jul 10 '13 at 05:47
  • Marked your answer as correct because I just randomly included another libz and it worked. An explanation of why would be great. – Carpetfizz Jul 10 '13 at 05:50
  • I had this problem in my unit tests, and same answer worked for me. just had to add libz.dylib to my Test Target – jonbauer Oct 06 '14 at 20:33