Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > frameworks, bundles, and dylibs. 3 questions.

frameworks, bundles, and dylibs. 3 questions.
Thread Tools
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 20, 2004, 08:16 PM
 
I'm trying to understand why there are so many library file formats on OS X and what they mean. It seems a bit redundant -- maybe someone here would be so kind as to educate me. (Note, I'm coming from a GNU/Linux background.)

1. What is the purpose of frameworks? (I.e. those directories in /System/Library/Frameworks, /Library/Frameworks, and ~/Library/Frameworks.) Why not just link the requisite *.dylib's into the executable? Is it simply to save me from typing -I/... -L/... -l/... into my makefile?

2. What's the difference between *.dylib files and *.bundle's? Actually, I should be asking, what's the difference between .dylib's and the no-extension files residing in *.bundle directories? Aren't they both just shared libs?

3. In frameworks -- usually in the Foo.framework/Versions/A directory -- there's an important looking file with no extension that the 'file' command tells me is a dylib. Why doesn't it have a .dylib filename extension? Why does it seem the filename extension convention is ignored here?

Thanks!
(Last edited by johnMG; Jun 20, 2004 at 08:23 PM. )
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jun 21, 2004, 12:16 AM
 
A framework wraps multiple versions of a dylib along with associated resource files and other support stuff like headers into one unified (you guessed it!) framework. A framework is one type of a bundle. An application is another type of a bundle.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 21, 2004, 12:02 PM
 
Originally posted by johnMG:
1. What is the purpose of frameworks? (I.e. those directories in /System/Library/Frameworks, /Library/Frameworks, and ~/Library/Frameworks.) Why not just link the requisite *.dylib's into the executable? Is it simply to save me from typing -I/... -L/... -l/... into my makefile?
As smeger said, frameworks are just a way of encapsulating a library with its associated headers and other resources for organisational reasons (rather than, say, having headers in /usr/include libs in /usr/lib and other stuff in /usr/share - which is rather messy). See http://developer.apple.com/documenta...rks/index.html.
[B]2. What's the difference between *.dylib files and *.bundle's? Actually, I should be asking, what's the difference between .dylib's and the no-extension files residing in *.bundle directories? Aren't they both just shared libs?
No. Mach makes a distinction between shared libraries (MH_DYLIB) and dynamically loadable bundles (MH_BUNDLE). For example, MH_BUNDLEs can be told to resolve symbols against an executable (-bundle_loader link flag), and can be unloaded (providing they don't contain Objective-C code) whereas dylibs can't. See ld(1) and http://developer.apple.com/documenta...section_4.html and stuff.

Note that the term "bundle" is also used in a more general sense to refer to packages of files that group stuff together - applications, frameworks, etc. See http://developer.apple.com/documenta...les/index.html
3. In frameworks -- usually in the Foo.framework/Versions/A directory -- there's an important looking file with no extension that the 'file' command tells me is a dylib. Why doesn't it have a .dylib filename extension? Why does it seem the filename extension convention is ignored here?
No idea, probably just an arbitrary decision. Why does it matter?
     
johnMG  (op)
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 21, 2004, 03:41 PM
 
Thanks for the replies smeger and Angus. And also Angus, thanks for the links. I'm reading them now.

Mach makes a distinction between shared libraries (MH_DYLIB) and dynamically loadable bundles (MH_BUNDLE). For example, MH_BUNDLEs can be told to resolve symbols against an executable (-bundle_loader link flag), and can be unloaded (providing they don't contain Objective-C code) whereas dylibs can't.

Ah.


> Why does it seem the filename extension convention is ignored here?

No idea, probably just an arbitrary decision. Why does it matter?


I thought maybe there was some important reason why, but I just wasn't getting it.

Thanks again.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:36 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2