RE: U vs. T in "nm -g" output..
RE: U vs. T in "nm -g" output..
- Subject: RE: U vs. T in "nm -g" output..
- From: "Ando Sonenblick" <email@hidden>
- Date: Tue, 30 Aug 2005 15:14:16 -0700
- Thread-topic: U vs. T in "nm -g" output..
Chris,
OK, changing the order of the libs does not prevent the error. I tried
the linker flags as you suggested but either I entered them wrong or
they game no extra details.
Is there no way just to say to Xcode, ignore multiple definitions and
just use the first one?
Unfortunately I'm porting a massive code base and the guy before me
didn't care about fixing multiple definitions (and CodeWarrior didn't
force him to). Ideally, I want to fix these but I need to get builds
being produced soon!
Thx,
Ando
It looks like foo is defined in one library and not the other, good.
Is it defined in your project that links to both of these?
What's the link order (determined by the order in which the libraries
appear in the Link Binary with Libraries build phase)? If B comes
before A, it may bring in A implicitly and reexport it, so that when
you bring in A you get a second copy of it. Try reordering A before
B, or omitting A entirely.
You can always add -Wl,-Y -Wl,999 to your Other Linker Flags and it
will give you more information about where the symbol definitions are
coming from. Posting the actual linker output from the build
transcript will help, too.
Oh, and as this has nothing to do with Carbon development, please
don't crosspost.
Chris
_______________________________________________
-----Original Message-----
From: xcode-users-bounces+asonenblick=email@hidden
[mailto:xcode-users-bounces+asonenblick=email@hidden] On
Behalf Of Chris Espinosa
Sent: Tuesday, August 30, 2005 2:50 PM
To: XCode Users
Subject: Re: U vs. T in "nm -g" output..
On Aug 30, 2005, at 2:38 PM, Ando Sonenblick wrote:
> OK... I answered my own question with "man nm" (shouldn't have had
> that
> beer at lunch).
If you drink, don't post. Use a designated coder. :-)
> But I still have a problem/question.
>
> I have a project which does NOT define the function foo() (does not
> include foo.cpp).
>
> I have two static libraries that the project includes.
>
> Lib A defines foo() (includes foo.cpp)
> Lib B has calls to foo() (includes foo.h but does not include foo.cpp)
>
> When I include both in the project and build the project I get a link
> error that _foo is multiply defined.
>
> When I run "nm -g" on Lib A I get
>
> T _foo
>
> And when I run it on Lib B I get
>
> U _foo
>
> By this I interpret that Lib A defines foo and that Lib B does not (U
> meaning Undefined).
>
> So the question is why the heck when I include both am I getting a
> "multiply defined _foo" link error!?!?!?!
>
> Link errors in Xcode are driving me crazy!
_______________________________________________
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