Is ZLib available in Cocoa?

  • Hi, All,

    I wonder how to use ZLib compression library in Cocoa? Is it included into
    any framework already or should I seek for a special ZLib Cocoa build or can
    I compile that C source which is available around the Net?

    Thanks.
  • On Oct 5, 2007, at 7:52 AM, Alexander Bokovikov wrote:

    > Hi, All,
    >
    > I wonder how to use ZLib compression library in Cocoa? Is it
    > included into any framework already or should I seek for a special
    > ZLib Cocoa build or can I compile that C source which is available
    > around the Net?

    zlib is included on the system as a dynamic link library at /usr/lib/
    libz.dylib.

    You can include it with your application, but you will have to get the
    headers from an on-line source distribution.

    The greatest danger with using the one on the operating system is that
    it might change when Apple releases a new OS or an update.

    If you consider that an unacceptable danger, then you can, of course,
    compile zlib yourself from sources on the network and include it in
    your application.

    Scott
  • There is an extension to NSData that provides compression. I don't remember
    the name of the lib or who provides it, but google NSData & compression.

    --
    Scott Ribe
    <scott_ribe...>
    http://www.killerbytes.com/
    (303) 722-0567 voice
  • > I wonder how to use ZLib compression library in Cocoa? Is it included into
    > any framework already or should I seek for a special ZLib Cocoa build or can
    > I compile that C source which is available around the Net?

      Search the cocoadev.com wiki. There's a category for NSData that
    adds this functionality (among others). Remember to set the
    appropriate linker flags in your target however.

    --
    I.S.
  • Hi, All,

    > If you consider that an unacceptable danger, then you can, of course,
    > compile zlib yourself from sources on the network and include it in  your
    > application.

    Thanks to all who answered. Yes, I'd like to use a static library, included
    into my project rather than to use a shared library. I've downloaded the
    zlib 1.2.3 source from the official site, but now I am not sure how to
    compile it. Should I compile it from a coomand line using its makefile or is
    it better to create a framework from these sources? If the last is better
    then how to do it? Should I manually include all .c and .h files into an
    empty project? And what project kind (target type) to use? Should it be a C
    project or a Cocoa framework?

    Perhaps we need to donate zlib with the xcode project template...

    Thanks.
  • > I've downloaded the
    > zlib 1.2.3 source from the official site, but now I am not sure how to
    > compile it. Should I compile it from a coomand line using its makefile or is
    > it better to create a framework from these sources? If the last is better
    > then how to do it? Should I manually include all .c and .h files into an
    > empty project? And what project kind (target type) to use? Should it be a C
    > project or a Cocoa framework?

    There's nothing inherently different about building this with XCode
    than any other IDE. XCode-related questions are best posed to the
    xcode-users list while questions about how to build this particular
    project are best posed to any forum(s) associated with that project.
    The particulars about how to build zlib have nothing to do with Cocoa.

    Now the NSData category to which I referred you does ... :-)

    --
    I.S.
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today