Why am I always getting the linker error: 'duplicate symbol'...?
Why am I always getting the linker error: 'duplicate symbol'...?
- Subject: Why am I always getting the linker error: 'duplicate symbol'...?
- From: "Frederick C. Lee" <email@hidden>
- Date: Mon, 21 Sep 2009 13:19:30 -0700
I'm trying to replace #define directives with c datatype directives.Example:
(1) #define x 123
versus...
(2) const unsigned x = 123;
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 ....'
I tried placing the (2) declaration at the top of a .m or .c file, but I get
the same linker error.
I've declared global constants in another application without a problem.
I've checked the compiler type within the build: gcc 4.2
What am I doing wrong?
_______________________________________________
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