Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Question about dynamic and static libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about dynamic and static libraries




On Dec 28, 2005, at 4:33 PM, Peter O'Gorman wrote:


On Dec 29, 2005, at 12:00 AM, Steve Checkoway wrote:

Things aren't always this cut and dry. For one thing, making a dynamic library out of it isn't usually feasible since mach-o's use of dynamic libraries leaves a lot to be desired. I'm referring to the install name of a library being required to be compiled into the application. If you want to distribute your application, not only do you have to distribute the dynamic library with it but also install it in the same location.

Look for @executable_path/ and @loader_path/ in the documentation, you can install dynamic libraries at paths relative to the application (or with Mac OS X 10.4 and later, relative to each other) using these as part of the install_name.

I didn't know about @loader_path, but I have used @executable_path for frameworks. I figured that it would work for dynamic libraries but if I'm going to the trouble of setting that, I might as well just make a framework out of the library. (I'd rather deal with configuring Xcode projects than working with the autotools in most cases.)


Actually, I suppose that's not entirely true, I could just build the library and use install_name_tool. I think that it might still pick up an installed library and use that instead, though.

- Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Re: Question about dynamic and static libraries (From: Bill Northcott <email@hidden>)
 >Re: Question about dynamic and static libraries (From: Steve Checkoway <email@hidden>)
 >Re: Question about dynamic and static libraries (From: "Peter O'Gorman" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.