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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to