Re: bsd dynamic library dependencies help
Re: bsd dynamic library dependencies help
- Subject: Re: bsd dynamic library dependencies help
- From: Jens Alfke <email@hidden>
- Date: Tue, 29 Dec 2009 08:04:52 -0800
On Dec 29, 2009, at 7:45 AM, Xochitl Lunde wrote:
> I created a new Xcode project and added targets for two of my BSD dynamic libraries, "foo" and "bar". The code in "foo" depends on the code in "bar". [...] Why is my "foo" library trying to link in symbols from "bar"? I don't have an executable created yet at all, just these two BSD dynamic library targets. How do I fix this?
foo is trying to link symbols from bar because it uses those symbols. This seems so obvious to me that I think either I'm misunderstanding your situation, or perhaps dynamic linking works very differently on BSD than on Mac OS X. If a dynamic library (or executable) uses a symbol, then the symbol either has to be defined in that library, or it has to be a known import from a specific dynamic library.
When building a dynamic library, you have to link in all of the libraries that it uses. Linking in another dynamic library won't copy it, it just records the dependency so it can be resolved at load time. It sounds like you need to add 'bar.dylib' to the 'foo' target. (You should also make sure to add the 'bar' target as a dependency of the 'foo' target, so that Xcode will know to build 'bar' first.)
—Jens _______________________________________________
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