• 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
[OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace


  • Subject: [OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace
  • From: Alastair Houghton <email@hidden>
  • Date: Thu, 2 Aug 2007 12:27:47 +0100

On 30 Jul 2007, at 18:56, Markus Hanauska wrote:

Any idea how one could link dylibs and a main binary against the same static library without duplicate symbol warnings and with every symbol that is a variable existing only once in the whole namespace?

Or maybe to better describe the issue:

How can I enforce that the symbol FOO is the same symbol across multiple dylibs and one executable binary? Is that possible?

There are two approaches that spring to mind.

The first is to put your shared symbol into a dylib of its own (possibly along with anything else you want shared between the frameworks and the executable). Then you link everything against it. I'm guessing (from what you've already said) that you don't want to do that, though.

If that doesn't suit, you need to tell your frameworks to link against your application. I *think* you can use the "-bundle_loader" flag for that, even if you're building a framework rather than a plug- in. The only problem you'll have is that this creates a chicken-and- egg situation if your app depends on the frameworks that now depend on your app... you can, of course, solve that problem by making a dummy executable that exports the required symbols to make the frameworks link, and use that as the -bundle_loader argument.

All of this probably belongs on the xcode-users list, of course, rather than cocoa-dev....

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: [OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: Thread Communication Conceptual Question
  • Next by Date: Re: [OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace
  • Previous by thread: Re: _NSFastFillAllLayoutHolesUpToGlyphIndex crash in NSLayoutManager
  • Next by thread: Re: [OT] Re: Mixing Static and Dynamic Librararies, Multiple Definitions of Symbol, Two-Level Namespace
  • Index(es):
    • Date
    • Thread