Framework versions and linkage
Framework versions and linkage
I thought the whole reason for having the multiple library symlinks
in /usr/lib was so that binaries could link against the generic
library name and have it resolve to the current version at runtime
(as is done with the library symlinks inside frameworks.)
I have been thinking about the last bit of this statement (which
appeared in a previous thread: Using libcrypto & the 10.6 SDK with a
minimum OS requirement of 10.5).
So I went and re-read the Framework Programming Guide (and it
certainly made a lot more sense now than it did the first time).
Looking at my app with otool -L I can see that it explicitly
references the major version of various frameworks, say:
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 751.0.0)
otool -l gives us
Load command 27
cmd LC_LOAD_DYLIB
cmdsize 96
name /System/Library/Frameworks/Foundation.framework/
Versions/C/Foundation (offset 24)
time stamp 2 Thu Jan 1 01:00:02 1970
current version 751.0.0
compatibility version 300.0.0
To me it seems that this code must link against version C, regardless
of whether versions D..Z exist in the bundle or not.
C is not at its original compatible version number but at 751, which
is nonetheless deemed to have retained a compatible interface with
version 300.
This implies that the linkage is not really variable. The app has to
find a compatible version of the major version C at the given path. If
not, it perishes.
If D exists our app can only link against it after recompilation.
Is this correct or does a horrible confusion reign?
Jonathan Mitchell
Developer
http://www.mugginsoft.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden