• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Duplicate symbol puzzle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Duplicate symbol puzzle (From: "McLaughlin, Michael P." <email@hidden>)
 >Re: Duplicate symbol puzzle (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Duplicate symbol puzzle
  • Next by Date: Re: bad_typeid dyld Error on Leopard (10.5)
  • Previous by thread: Re: Duplicate symbol puzzle
  • Next by thread: Re: Duplicate symbol puzzle
  • Index(es):
    • Date
    • Thread