curious linking behavior
curious linking behavior
- Subject: curious linking behavior
- From: "Jeff Schmidt" <email@hidden>
- Date: Tue, 2 May 2006 12:57:39 -0500
Using Xcode 2.2.1, I have a project with the following rough layout:
MainProj
- depends on SubProjA
- builds libSubProjA.a
- depends on SubProjB
- builds libSubProjB.a
- links to libSubProjA.a
- links to libSubProjB.a
There is a symbol defined in libSubProjB.a that libSubProjA.a
eventually needs to see (when MainProj links). It doesn't see it, but
does see every other symbol used from that library. MainProj fails to
link, saying that this symbol isn't found (an object in SubProjA
references it but can't find it).
This configuration works however:
MainProj
- depends on SubProjA
- builds libSubProjA.a
- depends on SubProjB
- builds libSubProjB.a
- links to libSubProjB.a
- depends on SubProjB
- builds libSubProjB.a
- links to libSubProjA.a
- links to libSubProjB.a
Simply making SubProjA dependent on SubProjB and forcing it to link
with libSubProjB.a solves that single link error.
Why? How is the linker missing that symbol when MainProj in the first
case links, if it CAN be found in the second configuration?
Especially given the dozens of other symbols referenced from
libSubProjA.a and defined in libSubProjB.a survive link intact in
either case. Using nm shows the symbol referenced and defined in the
appropriate libraries, and there isn't any name mangling going on.
_______________________________________________
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