Breaking News
Home / iOS / iOS Isuses / Xcode Project linking fails – Undefined symbols for architecture armv7

Xcode Project linking fails – Undefined symbols for architecture armv7

Issue

The project compiles but fails while linking with the following error.

Undefined symbols for architecture armv7:
  “_inflateEnd”, referenced from:
      -[ASIDataDecompressor closeStream] in ASIDataDecompressor.o
  “_inflate”, referenced from:
      -[ASIDataDecompressor uncompressBytes:length:error:] in ASIDataDecompressor.o
  “_deflateEnd”, referenced from:
      -[ASIDataCompressor closeStream] in ASIDataCompressor.o
  “_inflateInit2_”, referenced from:
      -[ASIDataDecompressor setupStream] in ASIDataDecompressor.o
  “_deflate”, referenced from:
      -[ASIDataCompressor compressBytes:length:error:] 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

Solution

These dependencies are in the lib libz.Please make sure that you link against libz correctly.Check that lib is included and marked as required in the “Link Binary With Libraries” build phase of your target. See the following screenshot.

libz project dependencies

[pb_builder]

Check Also

local variable ‘build_data’ referenced before assignment : TestFlight Error : Failed to upload build.

Scenario Trying to upload build to TestFlight fails in the end. Error local variable ‘build_data’ …

Advertisment ad adsense adlogger