Search code examples
xcodeswiftgzipnsdata

zlib in Xcode 7.0


I try to implement "NSDate+GZIP" in Xcode 7.0 using Swift 2.0. Without success so far because the module "zlib" can not be found (Error: "No such module 'zlib'").

This is what I have tried to do so far:

  1. Add libz.tbd to "Link Binary with Libraries" in Build phases > "No such module 'zlib'"

  2. Add "-lz" to "Other Linker Flags" in Build Settings > "No such module 'zlib'"

    • Go to Build Phases > Link Binary with Librairies > + > Add other
    • Do "CMD"+Shift+G (Go to folder) and type /usr/lib/
    • Adding libz.dylib > "No such module 'zlib'"

Same error occurs in 7.1 beta. Any further suggestions?


Solution

  • Please check:

    Swift compiler import paths in build settings as here: build settings

    zlib folder is yellow (added as a group): folder

    you have libz.tbd in linked fw and libs: linked fw

    Also try building the project before trying to use the module.