Re: Compilation leads to Undefined symbols of a nested static lib
Re: Compilation leads to Undefined symbols of a nested static lib
- Subject: Re: Compilation leads to Undefined symbols of a nested static lib
- From: Alfred Van Hoek <email@hidden>
- Date: Sun, 16 Mar 2008 12:13:52 -0400
On Mar 16, 2008, at 11:44 AM, Jean-Daniel Dupas wrote:
Le 16 mars 08 à 16:38, Alfred Van Hoek a écrit :
Have created a static lib (Carbon) that wraps calls into Cocoa,
"libMycarboncocoa.a". This static lib is used by a carbon static
lib, which is called "libMylib.a". When "MyFramework.bundle" is
compiled, Xcode complains that there are undefined symbols when
libMylib.a calls into libMycarboncocoa.a. Previously, when we did
not use libMycarboncocoa.a, MyFramework.bundle compiled fine with
libMylib.a.
Any suggestions?
Alfred
When you link your main bundle on your static library, The linker is
smart enought to strip unused function and so, it do not try to link
symbols used in those stripped functions.
There is probably functions in libMycarboncocoa.a that need
Cocoa.framework (or another framework). As long as you don't call
thoses function, your main bundle will not need Cocoa, but if your
bundle uses one if thoses function, it will require Cocoa to link.
So adding Cocoa.framework in your bundle project should solve your
problem.
(Note: maybe the missing symbol is not from Cocoa but from another
framework, but as you didn't give any hint about what symbol it is,
I guess it's a Cocoa symbol ;-)).
Thanks, but to recapitulate:
The libMycarboncocoa.a has wrapper functions defined that lead to the
undefined symbols, i.e., the symbols _MyFirstFunction,
_MySecondFunction etc are not found. And yes, this lib is linked to
the cocoa framework because the implementation of these wrapper
functions call into cocoa. We also tried additional linking of
MyFramework.bundle with the Cocoa framework, does not help, nor does
it help when MyFramework.bundle is additionally linked against
libMycarboncocoa.a.
Alfred _______________________________________________
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