• 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: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors


  • Subject: RE: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors
  • From: "Swar Systems" <email@hidden>
  • Date: Sat, 18 Jun 2005 20:05:28 +0200
  • Importance: Normal

Thanks a lot, Chris. The build log looks like this:
 
====

ld: multiple definitions of symbol TWCompositionsMgr::GetAllInstruments()

/Users/optimalsoft/SwarTools/build/SwarTools.build/SwarTools.build/Objects-normal/ppc/TWCompositionsMgr.o definition of TWCompositionsMgr::GetAllInstruments() in section (__TEXT,__text)

/Users/optimalsoft/SwarTools/build/SwarTools.build/SwarTools.build/Objects-normal/ppc/TWCompositionsMgr.o definition of TWCompositionsMgr::GetAllInstruments() in section (__TEXT,__text)

ld: multiple definitions of symbol TWCompositionsMgr::GetCompositionBPM()

/Users/optimalsoft/SwarTools/build/SwarTools.build/SwarTools.build/Objects-normal/ppc/TWCompositionsMgr.o definition of TWCompositionsMgr::GetCompositionBPM() in section (__TEXT,__text)

/Users/optimalsoft/SwarTools/build/SwarTools.build/SwarTools.build/Objects-normal/ppc/TWCompositionsMgr.o definition of TWCompositionsMgr::GetCompositionBPM() in section (__TEXT,__text)

====
 
I have only copied a few here, but I can send you the whole thing if needed (about 5000). But basically it's always the same pattern: each method is included twice within the .o file. What could be the reason for that?
 
Cheers!
 
Mariano
-----Message d'origine-----
De : xcode-users-bounces+info=email@hidden [mailto:xcode-users-bounces+info=email@hidden]De la part de Chris Espinosa
Envoyé : samedi, 18. juin 2005 17:47
À : Xcode-Users@Lists. Apple. Com
Objet : Re: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors

On Jun 18, 2005, at 7:01 AM, Swar Systems wrote:

I am porting some C++ code to OS X, and I am facing a sudden problem. Though the code compiled well, linked successfully with ZeroLink option on (by default), and ran quite well in debug mode, it suddenly stopped linking after I made a few changes. Unchecking the ZeroLink option now shows me about 5000 "multiple definitions of symbol" errors, even if I remove these changes I had added.

That means that you have linking errors. ZeroLink, true to its name, skips the linking step entirely, so things like multiple and missing definitions are ignored. We recommend using ZeroLink for debugging cycles, after your code is building correctly.

These are linkage errors. All sources build perfectly. I have also used "#ifndef" statements on each header file to avoid including it more than once in each .cpp.

Linking is a function of libraries and frameworks only, not of headers.

Can anyone help me by giving more details on when such an error is generated, and how I can avoid it?

Usually this is due to having extra, unnecessary libraries and/or frameworks. You'd have to open the Build Results window, click the Transcript button (looks like text), select the link errors in the build log, and copy and paste the transcript text into an email message for us to diagnose.

Chris

 _______________________________________________
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: 
 >Re: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Build Dependencies... or Why are you Rebuilding.
  • Next by Date: Re: Xcode2.1: Making a stand-alone app.
  • Previous by thread: Re: XCode 1.5 : "mutiple definitions of symbol <X>" linkage errors
  • Next by thread: Xcode2.1: Making a stand-alone app.
  • Index(es):
    • Date
    • Thread