How to get rid of this linker warning?
How to get rid of this linker warning?
- Subject: How to get rid of this linker warning?
- From: Rush Manbert <email@hidden>
- Date: Thu, 24 Jan 2008 16:35:16 -0800
I have found archive posts where others have asked about this problem,
but I did not see any answers, and I need an answer.
I have a BSD static library called libC.a which my customers will link
their applications against. I also have applications that link against it.
This library uses two other static libraries. They are libB.a and
libA.a. When I link libC, I specifically link in the other libraries by
adding “-lB and -lA” to my Other Linker Flags.
The library libB.a uses libA.a and I have applications that link against
libB.a (but not against libC.a). In order to make linking the
applications as painless as possible, when I link libB.a, I specifically
link in libA.a by adding “-lA” to the Other Linker Flags. This way, the
application doesn’t need to link against libB and libA, since he only
knows that he used libB.
Now for the problem. When I link libC.a, and any time I link an
application against libC.a I get warnings like this:
/usr/bin/libtool: warning same member name (ObjectA.o) in output file
used for input files: ../libB/build/Debug/libB.a(ObjectA.o) and:
../libA/build/Debug/libA.a(ObjectA.o) due to use of basename, truncation
and blank padding
In my real project I have been seeing this for a long time. It started
when I refactored some functionality out of my top level library and put
it into a utility library that was used in multiple places. Everything
works and I have always thought that I understood why it was happening.
Now I am interested in getting rid of the warning, but I don’t know how.
The problem is that libA.a has been linked into libB.a and libC.a, so
that the “member names” show up twice. I have constructed a simplified
case that demonstrates this.
I guess I could remove the “-lA” from the linker flags for libC, but
that also seems kludgey. If I used something from libA, I should just
link against it and I shouldn’t need to worry whether libB used libA
also. The linker should just take care of that and it seems to me that
it shouldn’t generate a warning.
I am using Xcode 2.4.1.
Does anyone have any other suggestions? I want the build to be clean
before I move to Leopard.
Thanks,
Rush
_______________________________________________
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