Re: CFBundleGetFunctionPointerForName
Re: CFBundleGetFunctionPointerForName
- Subject: Re: CFBundleGetFunctionPointerForName
- From: Dmitry Markman <email@hidden>
- Date: Sat, 15 Mar 2008 08:36:16 -0400
Hi, all
1. CFBundleGetFunctionPointerForName is able to find symbols without
underscore. That is a fact.
2. as Nava said model_call was declared in the static library, so when
she built bundle
linker just didn't resolve that symbol, because that symbol wasn't
used in the bundle
it is default ld behavior:
here is an excerpt form man ld
A static library (aka static archive) is a collection of .o files
with a table of contents that lists the global
symbols in the .o files. ld will only pull .o files out of a
static library if needed to resolve some symbol ref-
erence. Unlike traditional linkers...
to force linker to resolve all symbols one should use -all_load linker
flag:
-all_load Loads all members of static archive libraries
that will solve that problem
thanks
On Mar 13, 2008, at 1:39 PM, Nava Carmon wrote:
Why it does find it "as is" without prefix when I add it to the
bundle project and remove it from the static library?
On Mar 13, 2008, at 6:09 PM, Sherm Pendley wrote:
On Thu, Mar 13, 2008 at 10:38 AM, Nava Carmon <email@hidden>
wrote:
Hi All,
I have some bundle, that links with a static library. My
application loads that bundle and looks for an entry point:
modelEntry =
reinterpret_cast
<
ModelEntryProc
>
(CFBundleGetFunctionPointerForName(modelBundle,CFSTR("model_call")));
The function model_call is defined and declared in the static
library. I tried almost everything to get my application see this
symbol, but no success. The question is if it's possible at all?
May be I misinterpret the CFBundleGetFunctionPointerForName usage?
In my experience, CFBundleGetFunctionPointerForName wants symbols
to be prefixed with an underscore - that is, _model_call. They're
stored that way in the binary (it's a C thing) and the function
doesn't appear to add it for you before searching.
sherm--
_______________________________________________
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
Dmitry Markman
_______________________________________________
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