linking against a specific framework?
linking against a specific framework?
- Subject: linking against a specific framework?
- From: "John C. Daub" <email@hidden>
- Date: Wed, 26 Sep 2007 08:08:44 -0500
- Thread-topic: linking against a specific framework?
Hello.
One of the plugins my app uses links against the Python.framework. On my Mac
OS X 10.4.10 Xcode 2.4.1 dual G5 machine where I'm working and building, I
do have the /System/Library/Frameworks/Python.framework that Tiger provided
(Python 2.3.5). However, I also have Python 2.4.1 installed in
/Library/Frameworks.
In my project, I added a reference to the
/System/Library/Frameworks/Python.framework; you do a Get Info on the
framework entry in the project file's source list and it has the expected
path. So I built this morning and put my app on a Leopard box for testing.
When my app went to load the plugin, the plugin failed to load because:
Library not loaded:
/Library/Frameworks/Python.framework/Versions/2.4/Python
So while I said to link against the System framework, it's linking against
the Local framework. Why?
I looked in my build commands and see the ld command gets a "-framework
Python" for it's link command for the Python framework. So that seems to
explain it... the Local version is "first" in the search paths and thus what
gets picked up. So I changed the plugin targets' build settings to add an
explicit entry in FRAMEWORK_SEARCH_PATHS for /System/Library/Frameworks, and
that entry was first in the list. I rebuilt the plugin, it linked ok, I
copied it to the Leopard box and now it loaded and works fine.
While that works, it doesn't feel right... like it's risking overriding the
linking for a lot more than just the Python.framework. What I want is to
link against the system-provided/installed Python.framework, and not harm
the rest of the linking process (still linking to the correct Cocoa, Carbon,
Security, etc. frameworks). What would be the right right way to accomplish
this?
I'm thinking the FRAMEWORK_SEARCH_PATHS entry should probably instead be:
$(SDKROOT)/System/Library/Frameworks, and still leave it first in the path
list. Yes? Or something else? I tried it and it did build and runs ok...
just want to make sure I'm doing things the right way.
Thanx. :-)
--
John C. Daub }:-)>=
<mailto:email@hidden> <http://www.hsoi.com/>
"When one person can initiate war, by its definition, a republic no longer
exists." -- Ron Paul
_______________________________________________
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