1

I am following this tutorial

The tutorial states to add libz.1.2.3.dylib. library, but because I have downloaded newer or older library (I don't know exactly if my library is newer or older that the library in the tutorial, but 99% it is newer). So, when I tried to add the libz.1.2.3.dylib. library, I didn't find it. However, when I typed libz I found these choices:

enter image description here

which one should I choose please?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Carol Smith
  • 199
  • 1
  • 1
  • 16
  • possible duplicate of [libz.dylib versus libz.1.2.3.dylib versus libz.1.2.5.dylib](http://stackoverflow.com/questions/6932991/libz-dylib-versus-libz-1-2-3-dylib-versus-libz-1-2-5-dylib) – mmmmmm Jul 15 '14 at 18:27
  • Note to me and others read the related questions on the right before committing a question or answer – mmmmmm Jul 15 '14 at 18:35

1 Answers1

1

In using dynamic libraries the one you normally use is libX.major_version.dylib in this case libz.1.2.dylib. This is a link to a library libX.major_version.minor_version.dylib which here is libz.1.2.5.dylib

The rationale for this is that the major version is changed only when the API is changed, the minor version is updated when any change is made. Thus your program should work when it uses any of the same major version and so you want the latest version.

In this case the tutorial had an older install and so its libz.1.2.dylib. should have pointed to libz.1.2.3.dylib.

For you you should use libz.1.2.5.dylib which should be like the tutorials version but with bug fixes and possibly extra functions that don't matter here as the tutorial won't call the new functions.

Normally libX.1.x.dylib would be older than libX.2.y.dylib but the writers might produce bug fixes to the old API whilst also working on the new API

Following on from the rational I gave libz.dylib should be a link to the highest number library but I would not use it as you are writing to a particular API so I would use a version specific (In this case if missing a link the I would not trust what libz.dylib points to)

mmmmmm
  • 32,227
  • 27
  • 88
  • 117