Re: Linking to third-party Frameworks and dylibs from a plug-in
Re: Linking to third-party Frameworks and dylibs from a plug-in
- Subject: Re: Linking to third-party Frameworks and dylibs from a plug-in
- From: Dan Korn <email@hidden>
- Date: Mon, 10 Mar 2008 16:48:45 -0500
On Mar 10, 2008, at 4:16 PM, William H. Schultz wrote:
If you need that much flexibility, you may need to load the
libraries/frameworks manually and call functions via extracted
function pointers.
Thanks, but I'm using frameworks which export multiple C++ classes.
Calling LoadFrameworkBundle and then CFBundleGetFunctionPointerForName
for a whole mess of decorated C++ function names would be
excruciating. Or is there an easier way to do that?
Otherwise, my solution has been to use install_name_tool to modify
the install path and placing these libraries/frameworks inside the
Application's Frameworks directory.
I'm still a bit unclear as to exactly where I need to apply this
change. Do I need to modify the third-party Framework or dylib? Will
it modify the Framework after it's copied to my bundle, or will it
modify the source? What if the third-party Framework is being brought
into the project from a read-only location?
This inflexibility in the search paths is a common complaint, and it
is very un-Mac-like.
That's what I was thinking, too. Why can't the executable just define
a relative path from whence to load the library or Framework, without
the Framework dictating its location? Why do frameworks have to be
"locked down" so that they can't be both embedded into a bundle and
used from a shared location without hacking them? Shouldn't the load
location be up to the user of the library?
On Mar 10, 2008, at 4:20 PM, Sherm Pendley wrote:
Right - you need to change the install_path to something other than
the
above. :-)
@loader_path/../Frameworks
As you've discovered, dyld expands @executable_path at runtime to
the path
of the main executable binary. On the other hand, @loader_path
expands to
the path of the binary to which the framework is directly linked -
in this
case, the plugin binary.
@loader_path requires Tiger or newer, so including a framework in a
loadable
bundle is unsupported prior to Tiger.
sherm--
Thanks Sherm. I did see the loader_path setting, but in the release
notes for Leopard (10.5). Does this actually work in Tiger?
Thanks,
Dan
_______________________________________________
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