multiple definitions errors
multiple definitions errors
- Subject: multiple definitions errors
- From: Dan Korn <email@hidden>
- Date: Wed, 25 Jun 2008 18:17:34 -0500
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