Re: Question about static linking...
Re: Question about static linking...
- Subject: Re: Question about static linking...
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 10 Mar 2006 18:52:48 -0500
Hi Chas! It sounds like you may be misunderstanding the output of the
nm tool. It's not unexpected for both private and exported symbols to
show up in that output. You should look for capital "T" near symbols
that are expected to be exported (and linkable) by external code.
Little "t" symbols will not be exported. More details in "man nm."
You might consider using Xcode's fairly new (as of 2.2) "Object File"
target kind, which allows you to package the compiled results of
several source files into a single ".o" which can be linked in by
your external client. This target type also respects export lists
like a static library, but doesn't postpone the internal symbol
resolutions like a library does.
In many instances I think the new "Object File" target type is
preferable to either dynamic or static libraries.
Daniel
On Mar 9, 2006, at 7:31 PM, Chas Spillar wrote:
Hello,
I want to create a static library which only exports a few function
calls.
Then I want to include this in another target to be used with
another target
I am building.
I tried the following:
1) Created a Carbon static library (foo.a),
2) Created an export file foo.exp,
3) Indicated the following options in the build settings for the foo
library:
Export Symbols File = foo.exp
Symbols Hidden by Default = checked
4) Included the library in my other target (bar)
However, there are two problems that I see:
1) My library foo.a when viewed with nm -m shows all the external and
private symbols. I want these other symbols to not show up in the
build
library.
2) When linking my other target (bar) it doesn't find the symbols
in my
static library.
Usually, I could just include the files for the library in my target
directly, but I need to give my project to an external programmer
and I
can't give out the sources for this particular library.
Any help would be appreciated,
Thank you,
Chas.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
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