Re: static library function inlining
Re: static library function inlining
- Subject: Re: static library function inlining
- From: Shaun Wexler <email@hidden>
- Date: Tue, 16 Mar 2004 15:12:32 -0800
On Mar 16, 2004, at 2:26 PM, Chris Espinosa wrote:
Inlining has to be done during compilation, not linking. Your
projects that share the common functions each have to include the
headers and sources of those functions, and not a static library
containing them. The functions should be marked in the headers with
the C inline keyword. You don't need -finline-functions; the keyword
does the job.
That's how I first tried it, but I deleted the static lib and tried it
again, to reconfirm. The problem doing it this way was that I get
"multiple definitions of symbol" warnings in every target.
Project:
common.h - inline functions
common.m - inline functions
TargetA.framework - includes common.h and common.m; symbols are
defined.
TargetB.plugin - links to TargetA.framework. Includes common.h and
common.m source files; symbols are then redefined (a linker warning is
issued for every symbol).
TargetB code needs to have "rubber-stamped" common.m inline functions,
and not reference TargetA's (duplicate) symbols. In Shark, the
resultant code still plays register hockey and is called thru a blr,
but at least the _dylib_stub has been eliminated. So is this a
namespace problem? What else can I do?
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.