Re: Why am I always getting the linker error: 'duplicate symbol'...?
Re: Why am I always getting the linker error: 'duplicate symbol'...?
- Subject: Re: Why am I always getting the linker error: 'duplicate symbol'...?
- From: Kyle Sluder <email@hidden>
- Date: Mon, 21 Sep 2009 13:24:13 -0700
On Mon, Sep 21, 2009 at 1:19 PM, Frederick C. Lee
<email@hidden> wrote:
> I place this at the top of the .h (or .m) file, outside of any class or
> method as stand alone.
>
> However, every time I try to use the (2) declaration (within a .h file) the
> linker gives the error: 'duplicate symbol _x in ....'
Think about it: every time the preprocessor transcludes your header
file into a translation unit, it's going to emit another symbol
declaration. The linker is going to try to combine all your compiled
object files, each one declaring its own "x".
You might want to review your favorite C documentation. I always preferred K&R.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden