架构i386的未定义符号:“_deflate”,在libMo.a中从PlatCompress(enumCompressOperation,CompressCookie *,void *,long)引用

我正在使用SUP来完成原生的iOS应用程序。 我已经包含了这个库,并给出了Xcode中的链接path。 当build设得到以下错误:

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) 

请帮助我如何解决这个错误。我是新来的本地iOS开发使用SUP。

谢谢。

我也有一个相同的错误。

将“libz.dylib”添加到目标框架 – “构build阶段”选项卡 – >“链接二进制文件与库”

希望能为你工作。

从Xcode 7开始,而不是添加libz.dylib,你应该这样做:

  • 转到项目Build Settings选项卡
  • searchOther Linker Flags
  • 添加-lz作为链接器标志(请参见屏幕截图)
  • 在“ Product菜单中,再次select“ Clean

lz链接选项

架构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) 

我也有同样的问题,我想你没有包含libz.dylib库

要做到这一点:

  1. 去目标部分
  2. 构build阶段选项卡
  3. 链接二进制文件与库
  4. 点击+button
  5. searchlibz.dylib
  6. clcik添加button。

1.go到目标部分

2.build立阶段选项卡

3.与库链接的二进制文件

4.点击+button

5.search libz.tbd(或者libz.dylib)

6.点击添加button。