Mailing Lists: Apple Mailing Lists

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

Rép. : Re: Shared Objects and dyLibs



Christoph Pfisterer wrote :

> Florent wrote:
>
> >I am currently working on an OpenAL port to Darwin/MacOS X and I am
> >having some troubles when building a dynamic library.
> >I used the -dynamiclib option with cc to build the dynamic library,
> >and I got the following error :
> >
> >ld: common symbols not allowed with MH_DYLIB output format
>
> You must compile the source files with the '-fno-common' compiler
> flag. I'm not sure what they mean with common symbols, but using the
> flag helps. ;-)
>
> Probably you'll also need to specify the '-undefined suppress' flag
> when linking...

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 ?


------------------------------------
Now it's time to hang up your Internet connection and to come back to normal life...
email@hidden (Florent Boudet)




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.