• 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
Re: multiple definitions errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple definitions errors


  • Subject: Re: multiple definitions errors
  • From: Dan Korn <email@hidden>
  • Date: Thu, 26 Jun 2008 10:49:59 -0500

Okay, I'll try asking this another way:

How can I prevent my dynamic library from exporting every single function?

Any tips would be greatly appreciated. Even if the answer is RTFM, a nudge in the right direction towards a particular document would be very helpful.

Thanks,
Dan

On Jun 25, 2008, at 6:17 PM, Dan Korn wrote:

I have an Xcode 2.5 project which builds a bundle (an Acrobat plug- in), which in turn links with multiple static libraries, also built with Xcode 2.5, all from C++ code. I'm trying to convert one of the static libraries to a dynamic library, but I'm having trouble getting it to link.

Here's the scenario: The main bundle project links to a static library (libfmstatus_macho_d.lib) and a dynamic library (libfpunicodeui_macho_d.lib). Both of these libraries link in turn to another static library (let's call it "S2"). When I go to link my main project, I'm getting "multiple definition" errors for just about every symbol in library S2. For instance:

/Xcode2.5/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: multiple definitions of symbol vtable for MFC2PP::CComboBox
/Projects/FusionPro-mainline/FusionProWorkspace/FusionProMac/ FusionPro/fmstatus/build/Debug/Default/ libfmstatus_macho_d.lib(CComboBox.o) definition of vtable for MFC2PP::CComboBoxin section (__DATA,__const)
/Projects/FusionPro-mainline/FusionProWorkspace/FusionProMac/ FusionPro/FPUnicodeUI/build/Debug/Default/ libfpunicodeui_macho_d.lib(CComboBox.o) private external definition of vtable for MFC2PP::CComboBoxin section (__DATA,__const)

Here's another one that's a little different:

/Xcode2.5/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: multiple definitions of symbol MFC2PP::CComboBoxView::DisableSelf()
/Projects/FusionPro-mainline/FusionProWorkspace/FusionProMac/ FusionPro/fmstatus/build/Debug/Default/ libfmstatus_macho_d.lib(CComboBox.o) definition of MFC2PP::CComboBoxView::DisableSelf() in section (__TEXT,__text)
/Projects/FusionPro-mainline/FusionProWorkspace/FusionProMac/ FusionPro/FPUnicodeUI/build/Debug/Default/ libfpunicodeui_macho_d.lib(CComboBox.o) private external definition of MFC2PP::CComboBoxView::DisableSelf() in section (__TEXT,__text)

(Many more like these two.)

In all four of the projects, I have "Symbols hidden by default" [GCC_SYMBOLS_PRIVATE_EXTERN, -fvisibility=hidden] checked. It's my understanding that this should prevent anything at all from being exported from a dynamic library, unless I use an export list file or a "#pragma GCC visibility" or __attribute__((visibility("xxx"))) specifier, none of which I am using.

I've poured over this:
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html >


But I can't seem to do anything to prevent the dynamic library from exporting just about everything. What am I missing here?

Thanks,
Dan

_______________________________________________ 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
  • Follow-Ups:
    • Re: multiple definitions errors
      • From: Dan Korn <email@hidden>
References: 
 >multiple definitions errors (From: Dan Korn <email@hidden>)

  • Prev by Date: Re: Attach library (.a) in Xcode
  • Next by Date: Re: Attach library (.a) in Xcode
  • Previous by thread: multiple definitions errors
  • Next by thread: Re: multiple definitions errors
  • Index(es):
    • Date
    • Thread