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: "Sherm Pendley" <email@hidden>
- Date: Mon, 10 Mar 2008 17:20:24 -0400
On Mon, Mar 10, 2008 at 2:58 PM, Dan Korn <
email@hidden> wrote:
I'm using Xcode 2.5 to build a plug-in to a third-party application.
Both the plug-in and the application are Mach-O Universal Binary (ppc
and i386, 32-bit). My plug-in uses several third-party libraries
which I have received as Frameworks and dylibs.
I've tried to put the Frameworks and dylibs in both /Library/
Frameworks and in the Frameworks folder in my plug-in's bundle, with
no success. I get messages like this in the Console log, for several
of them:
> Library not loaded: @executable_path/../Frameworks/<library
> name>.dylib
If I use otool -L on any of these dylibs or Frameworks, it seems to
indicate that each Framework or dylib has been built with its
INSTALL_PATH set to one of these two values:
@executable_path/../Frameworks/
$(USER_LIBRARY_DIR)/Frameworks
I have the source code and Xcode projects for a couple of these third-
party components, so I could change the INSTALL_PATH and rebuild them,
but neither of the above paths seems to work for embedding a Framework
inside my plug-in bundle,
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--
_______________________________________________
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