Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing an iphone app and working through some sample code I saw, which uses libz.dylib. I did some research and found nothing enlightening, other than libz.dylib could be used for zip files, but other frameworks are prefered...

I'm dealing with a pdf sample, so why use libz.dylib? In general, what are dylib? And why all the versions?

share|improve this question
up vote 26 down vote accepted

A file ending in the extension .dylib is a dynamic library: it's a library that's loaded at runtime instead of at compile time. If you're familiar with DLLs from Windows or DSOs, it's more or less the same type of thing with a few twists. The Dynamic Library Programming Topics section of the Mac OS X Developer Library covers all the details about the format and what you should be aware of.

libz.dylib is the dynamic library for Zlib, a general compression library. PDFs can (and usually do) use zlib to compress different aspects of the data contained within them, but accessing the PDF data at that level is pretty low-level, and higher-level libraries would abstract most of that type of stuff.

share|improve this answer

dylib is short for DYnamically linked LIBrary They are analogous to a windows *.dll file. They contain generic, unmodifiable code intended to be reused by many applications.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.