1

I am trying to update Zlib on Xcode 7.1

According to zlib.h on /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/include, My Zlib version is 1.2.5.

I am trying to update it to 1.2.8

Is there a way to update xcode lib ?

I try to add libz.1.2.8.dylib to Link Binary With Libraries however my app still using zlib 1.2.5

Thanks in advance

Adrian
  • 273
  • 1
  • 4
  • 14
  • 1
    Compile it yourself. See [this](https://gist.github.com/dulaccc/75f1f49f53e544cef549) github repo, – trojanfoe Nov 17 '15 at 08:54
  • I compiled it already using that link and I add dylib to Link Binary With Libraries, but my app still using 1.2.5 – Adrian Nov 17 '15 at 08:56
  • 1
    OK, well if you are trying to use it via `.dylib`, you are aware that it will have to be bundled with the `.app` and only iOS 8+ supports this? There may be complications for other `.dylib` files that want to use zlib as well. Things might get messy... – trojanfoe Nov 17 '15 at 08:58

1 Answers1

0

I managed to do this by:

  1. Rename libz.1.2.8.dylib to libz.dylib and add it to Link Binary With Libraries

  2. Add zlib.h using module.modulemap. Example

    module zlib [system] { header "zlib/zlib.h" export * }

  3. Select the target -> Build Settings -> Swift Compiler Search Path -> Add folder where you store module map on Search Path

  4. use import zlib to use zlib

Referenced from https://github.com/1024jp/NSData-GZIP

Adrian
  • 273
  • 1
  • 4
  • 14