Linking woes
Linking woes
- Subject: Linking woes
- From: Brad Oliver <email@hidden>
- Date: Wed, 29 Nov 2006 11:26:41 -0700
I've run into a bit of a stumper with the linker in Xcode 2.4.1
Here's the background: I'm overriding wprintf, vfwprintf and related
functions with my own implementations based on Darwin source. So I've
got a project that creates a static library (.a) and a BSD command-
line app that exercises the test cases.
When I link this library in my BSD command-line app, all works fine
and it passes the 2-line test harness I've set up to demonstrate that
it's being used.
When I link the library into the app I really need it for, I get a
linker error: "multiple definitions of symbol _vfwprintf". This
larger app links to various frameworks like Carbon and System and is
a large packaged app. I'm using the latest 10.4u SDK, as far as I know.
I've set the build settings in my simple command-line app to match my
bigger app as closely as possible and still see the discrepancy. The
major difference between the 2, that I can see, is that the bigger
app also links against a bunch of other intermediate static libraries
that are generated during the build. These other static libraries do
use the wprintf routines I hope to override, but do not directly link
to the .a file I've created (doing so does not eliminate the link
error).
Key settings: DWARF is used, dead-code stripping is on (along with -
gfull), only link essential symbols is on, it's using the dynamic
version of the C++ library, "Link with Standard Libraries" is on,
single-object prelink is off, stripping is off, PIC-dependent code is
on (-mdynamic-no-pic), Fix&Continue and ZeroLink are off, symbols
hidden by default is on. There is a prefix header and it's
precompiled (another difference between builds).
The other wrinkle is that this larger app contains routines to
override fopen and a few others, and I don't get multiply-defined
link errors for those (and they work as expected). The difference
there being that these others are not being linked into the final app
via a static .a library - they're in a source module that's directly
in the app target.
--
Brad Oliver
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