Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rép. : Re: Shared Objects and dyLibs



> Thanks. But the -fno-common didn't work, neither did the -undefined suppress
> flag...
> I still have :
>
> ld: common symbols not allowed with MH_DYLIB output format
> foo.o definition of common _foo (size X)
> ...
>
> where _foo is the symbol of a global variable. So it seems global variable
> symbols are not supported at all in MH_DYLIBs, or I am missing a flag...
> But in my case, I have no really need to share the symbol outside of the lib.
> I just want it to be statically linked with the library code. How can I tell
> to dyld which symbols should be exported and which should not ?

What is not supported is multiple global symbols with the same name.
If you have...

int foo;

...in foo.c, and...

char foo[256];

...in bar.c, then you need to either define one or both of them as static,
so they dont leave the scope of the file, and thus dont get exported
globally, or rename one of them.

Ernesto.


References: 
 >Rép. : Re: Shared Objects and dyLibs (From: Florent <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.