• 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: Release compile failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Release compile failure


  • Subject: Re: Release compile failure
  • From: Paul <email@hidden>
  • Date: Sat, 12 Jan 2008 23:04:21 -0500

Igor was correct.

The problem was that I was initializing these values in my header files. I don't know why I thought that was a good idea, but it seemed to make sense at the time.

Thanks, everyone, for your help!

On Jan 12, 2008, at 3:17 PM, Igor Mozolevsky wrote:

On 12/01/2008, Paul <email@hidden> wrote:
The LINKER is confused? What about me? ;-)

My definitions for the two example errors are:

       NSString *ACMTriggerEnabledVisibleKey =
@"triggerEnabledIsVisbleInTable";
and
       NSRange shortRange = { 2, 8 };

The first one being for the PreferenceController and the second one
being used with substringWithRange:

They are defined in separate (from each other) .h files, and I have
verified that they are both defined only once.

Ah, ok, so your problem, or rather the linker's problem with you, is that you've initialized those variables in the .h files. Each of the .m files is compiled separately into an object (.o) file. Each object file basically contains some binary code to execute and a table of symbols. Now, if your .h file is included in several .m files, each .o file from the .m file would have a definition of the variables you use (ignore the underscore).

(A really naive version of what's going on is) The linker then joins
all of the .o files and libraries into a single executable. To do so
the linker builds a table of symbols for the executable from the
tables included in the objects, but when it encounters the same symbol
name together with an explicit definition of what value the symbol
holds, the linker gets really confused (it doesn't care that the
values are identical, as far as it knows the symbols must not be
redefined. The way to fix it is to use extern:

http://groups.google.com/group/comp.lang.c/browse_thread/thread/d5a63ea037fadb18/414a0636c308baff?lnk=st&q=extern

Cheers,
Igor :-)

***** Paul ***** email@hidden email@hidden ICQ #11034669

-----

>>> Bozosity Of The Day <<<

Daily proof that there is no shortage of bozosity when it comes to expert pontifications. From garage.com:
------------------------------------------------------------------


"[Man will never reach the moon] regardless of all future scientific advances."

-- Lee DeForest, inventor of the audion tube, New York Times, February 25, 1957

_______________________________________________

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


  • Follow-Ups:
    • Re: Release compile failure
      • From: Uli Kusterer <email@hidden>
References: 
 >Release compile failure (From: Paul <email@hidden>)

  • Prev by Date: Curious about copyWithZone message from NSArrayController in "GC required" project
  • Next by Date: Re: Apple Help and remote help content?
  • Previous by thread: Re: Release compile failure
  • Next by thread: Re: Release compile failure
  • Index(es):
    • Date
    • Thread