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: Peter O'Gorman <email@hidden>
- Date: Sun, 16 Mar 2008 11:43:05 -0500
Dmitry Markman wrote:
> I hope solution for the
> discussion for CFBundleGetFunctionPointerForName will help you
> namely use -all_load flag, when you link your final binary
>
> see also man page for the linker ld
-all_load is not usually an ideal solution, it causes all members of all
static archives to be loaded into the output. There is no way to select
which static archives are to have all member objects loaded (unlike,
e.g. the GNU ld --whole-archive flag). This can mean getting a bloated
output with unnecessary objects, getting static link time errors for
multiply defined symbols, or getting run time errors when the version of
the symbol foo that ends up being used is not the one the developer
expected. Problems are especially prevalent when using the 10.3.x SDK
and gcc-3.x because libgcc and libstdc++ for that compiler ship as
static archives.
I would suggest creating a reloadable object instead of a static archive
where you would want all members of the archive loaded by the static
linker. I believe there is a target option in the Xcode gui to create
one (the equivalent of ld -r *.o)
Peter
--
Peter O'Gorman
http://pogma.com
_______________________________________________
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