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



on 1/30/01 6:05 PM, Matt Watson at email@hidden wrote:

> You probably have some code like this:
>
> /* foo.h */
>
> int foo;
>
> /* foo.c */
> #include "foo.h"
>
> /* bar.c */
> #include "foo.h"
>
> Now, both foo.o and bar.o have common definitions of foo. This is bad for
> many reasons that I won't go into now. Suffice it to say that you don't
> want to do this. You should move the definition of foo from the header
> into one of the .c files and make the header say:
>
> /* foo.h */
> extern int foo;
>
> I'm guessing, but that's the most common way I've seen this particular
> problem manifest itself.

I'm quite confident '-fno-common' would deal with that case...

Ernesto.


References: 
 >Re: Rép. : Re: Shared Objects and dyLibs (From: Matt Watson <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.