Mac SDK libraries: What's in there? foo.dylib vs foo.A.dylib vs foo.B.dylib

StackOverflow https://stackoverflow.com/questions/18420836

  •  26-06-2022
  •  | 
  •  

سؤال

I'm poking around in the SDKs, trying to understand what's actually included.

I noticed that dylibs sometimes ship in multiple versions, e.g.

ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib
...
libBSDPClient.A.dylib
libBSDPClient.dylib
...
libSystem.B.dylib
libSystem.dylib
...

What are these .A and .B versions for? Who is using what?

هل كانت مفيدة؟

المحلول

The A and B etc denote an API version. The reason you're seeing two of each is because the non versioned (e.g. libSystem.dylib) is , in fact, a symbolic link (read:shortcut, alias) to the versioned one. you can see that if you do ls -F (and see @s for links) or ls -l ( and see the ->, e.g.

lrwxr-xr-x@ 1 root wheel 21 Aug 4 19:59 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libBSDPClient.dylib -> libBSDPClient.A.dylib

So there's nothing much to worry about here. Basically, if there is ever a newer version, you can simply link to it instead of the older one (using ln -s). This is an old UN*X trick, not just in Mac OS (also used in Linux on .so files). Most are version A, btw. libSystem, though , is B (it's been modified quite a bit since the inception of OS X)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top