Undefined symbols for architecture i386: "_deflate", referenced from PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a

IphoneIosSybaseSup

Iphone Problem Overview


I'm doing native iOS application using SUP.As per documentation; i have included the library and given the link path in Xcode. While building getting following error:

Undefined symbols for architecture i386:
  "_deflate", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in         libMo.a(tlplatcompress.o)
  "_deflateEnd", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_deflateInit_", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*, long), void*, void**) in libMo.a(tlplatcompress.o)
  "_deflateParams", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*, long), void*, void**) in libMo.a(tlplatcompress.o)
  "_inflate", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_inflateEnd", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_inflateInit_", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*,  long), void*, void**) in libMo.a(tlplatcompress.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help me how to solve this error.I'm new to native iOS development using SUP.

Thanks.

Iphone Solutions


Solution 1 - Iphone

I also had a same error.

Add libz.dylib to framework from the target -> Build Phases tab -> Link Binaries With Libraries,

hope that will work for you.

Note: If libz.dylib not found, try adding libz.tbd

Solution 2 - Iphone

Starting with Xcode 7, instead of adding libz.dylib, you should do this:

  • Go to the project Build Settings tab
  • Search for Other Linker Flags
  • Add -lz as a linker flag (see screenshot)
  • In the Product menu, select Clean before building again

lz link option

Solution 3 - Iphone

Undefined symbols for architecture i386:

  "_deflate", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in         libMo.a(tlplatcompress.o)
  "_deflateEnd", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_deflateInit_", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*, long), void*, void**) in libMo.a(tlplatcompress.o)
  "_deflateParams", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*, long), void*, void**) in libMo.a(tlplatcompress.o)
  "_inflate", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_inflateEnd", referenced from:
      PlatCompress(enumCompressOperation, CompressCookie*, void*, long) in libMo.a(tlplatcompress.o)
  "_inflateInit_", referenced from:
      StartCompression(enumCompressOperation, unsigned char, long (*)(void*, void*,  long), void*, void**) in libMo.a(tlplatcompress.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I had also the same problem,I think you didn't include the libz.dylib library.

To do so:

  1. go to target section
  2. Build Phases tab
  3. Link Binaries With Libraries
  4. click on + button
  5. search libz.dylib
  6. clcik on add button.

Solution 4 - Iphone

1.go to target section

2.Build Phases tab

3.Link Binaries With Libraries

4.click on + button

5.search libz.tbd (or libz.dylib)

6.click on add button.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbapiView Question on Stackoverflow
Solution 1 - IphoneDhaval H. NenaView Answer on Stackoverflow
Solution 2 - IphoneAbhi BeckertView Answer on Stackoverflow
Solution 3 - Iphoneasheesh VermaView Answer on Stackoverflow
Solution 4 - IphoneVinoth AnandanView Answer on Stackoverflow