Re: Duplicate symbol puzzle
Re: Duplicate symbol puzzle
- Subject: Re: Duplicate symbol puzzle
- From: "Sean McBride" <email@hidden>
- Date: Thu, 20 May 2010 12:43:12 -0400
- Organization: Rogue Research Inc.
On Thu, 20 May 2010 09:38:18 -0700, Jens Alfke said:
>C doesn't implement 'const' very well.
>
>In C++ the above declaration would just define a compile-time constant
>similar to an enum value. But in C the semantics are just like declaring
>a regular global variable, except that it's illegal to change its value.
>And since you put this in a header, you get the same duplication problem
>you get if you declare any global in a header without using 'extern'.
>
>The best way to fix it is to use an enum:
> enum {
> LOGFILE = 0x00000001ULL;
> }
>Or you can use Objective-C++ by changing your source files' extensions
>to ".mm".
I would advise against switching to Obj-C++ just for that. The dev
tool's support for C++ is not as good as C/Obj-C. You'll loose the
ability to Refactor and use the static analyzer, amongst other things.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden