• 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
Duplicate symbol puzzle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Duplicate symbol puzzle


  • Subject: Duplicate symbol puzzle
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Thu, 20 May 2010 11:22:09 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Duplicate symbol puzzle

Today I encountered a strange error in a Cocoa app with Xcode 3.1.4
targeting Leopard.

Most of the source files in this project are .mm but a few are .m since they
do not reference any STL-type classes.

The error I got was a load error for duplicate symbol _LOGFILE.  LOGFILE is
a defined constant in a header, Flags.h.

const flagType LOGFILE = 0x00000001ULL;

The "duplication" was between two .m files both of which #imported Flags.h
which, in fact, is included in most of my source files.

I "fixed" the error simply by renaming one of the files with the duplicate
symbol to .mm.

I cannot understand this error since i) it was my impression that #import
included headers only once and ii) the fix seems that it should be
irrelevant.

FWIW, Flags.h is also protected by a #ifndef construct as well.  Also,
cleaning and rebuilding the project was ineffective.

So what am I missing?

--
Mike McLaughlin

 _______________________________________________
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

  • Follow-Ups:
    • Re: Duplicate symbol puzzle
      • From: Markus Hitter <email@hidden>
    • Re: Duplicate symbol puzzle
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: bad_typeid dyld Error on Leopard (10.5)
  • Next by Date: Re: Duplicate symbol puzzle
  • Previous by thread: Re: Snow Leopard XCode Console search is unusable
  • Next by thread: Re: Duplicate symbol puzzle
  • Index(es):
    • Date
    • Thread