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: Rép. : Re: Shared O bjects and dyLibs



I finally found the stupid error I made...
What I did:

foo.c:
int bar;

#cc -c foo.c
#cc -dynamiclib -o libfoo.dylib foo.o -fno-common
ld: common symbols not allowed with MH_DYLIB output format
/var/tmp/cc001881-foo.o definition of common _bar (size 4)
/usr/bin/libtool: internal link edit command failed

foo.o didn't get compiled with -fno-common and the error persisted, but I didn't care because foo.o was one of the zilliard objects involved in the lib...
Thanks!


Matt Watson wrote:

> On Tue, 30 Jan 2001, Ernesto Corvi wrote:
> > I'm quite confident '-fno-common' would deal with that case...
>
> Sure, it deals. It just fails in a slightly different way:
>
> # cc -Wall -dynamiclib -o /var/tmp/foo.dylib /var/tmp/foo.c /var/tmp/bar.c
> -fno-common
> ld: multiple definitions of symbol _foo
> /var/tmp/ccuraaaa.o definition of _foo in section (__DATA,__common)
> /var/tmp/ccgxaaaa.o definition of _foo in section (__DATA,__common)
> /usr/bin/libtool: internal link edit command failed
> # cc -Wall -dynamiclib -o /var/tmp/foo.dylib /var/tmp/foo.c /var/tmp/bar.c
> ld: common symbols not allowed with MH_DYLIB output format
> /var/tmp/ccVraaaa.o definition of common _foo (size 4)
> /usr/bin/libtool: internal link edit command failed
>
> Either way, you need to change the code. I was just pointing out the idiom
> that I've seen most often when running into this error.
>
> matt.
> _______________________________________________
> darwin-development mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/darwin-development
>
>

Il est maintenant temps de clore votre connection internet et de reprendre une vie normale...
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.