• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
curious linking behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: RE: Linker can't find symbol _environ in Framework
  • Next by Date: RE: Linker can't find symbol _environ in Framework
  • Previous by thread: Re: Linker can't find symbol _environ in Framework
  • Next by thread: [Q] is there any good replacement for the Xcode?
  • Index(es):
    • Date
    • Thread