• 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: Weird error situation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird error situation


  • Subject: Re: Weird error situation
  • From: Chris Espinosa <email@hidden>
  • Date: Sun, 23 Sep 2007 21:37:06 -0700


On Sep 23, 2007, at 8:24 PM, Adam wrote:

Ok I don't know the context of the error (I linked to the code, so that may help). It doesn't tell me where the error is taking place (because it's not specific to one of the lines. Here is the error:

    cd "/Users/atg/Desktop/Projects/Programming Project/Builds/Basic_SDLOGL_001"
    /usr/bin/g++-4.0 -o /Users/atg/Desktop/Projects/Xcode\ Projects/Deployment/Basic_SDLOGL_001.app/Contents/MacOS/Basic_SDLOGL_001 -L/Users/atg/Desktop/Projects/Xcode\ Projects/Deployment -F/Users/atg/Desktop/Projects/Xcode\ Projects/Deployment -F/Library/Frameworks -filelist /Users/atg/Desktop/Projects/Xcode\ Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001\ (Upgraded).build/Objects-normal/ppc/Basic_SDLOGL_001.LinkFileList -framework GLUT -framework Foundation -framework AppKit -framework OpenGL -framework Cocoa -arch ppc -Wl,-Y,1455 -framework SDL
/usr/bin/ld: multiple definitions of symbol _curr_piece
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/sdl_tetris_002.o definition of _curr_piece in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/Other_functions.o definition of _curr_piece in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _fileout
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/sdl_tetris_002.o definition of _fileout in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/Other_functions.o definition of _fileout in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _next_piece
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/sdl_tetris_002.o definition of _next_piece in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/Other_functions.o definition of _next_piece in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/tile_init_001.o definition of _curr_piece in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/tile_init_001.o definition of _fileout in section (__DATA,__common)
/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001 (Upgraded).build/Objects-normal/ppc/tile_init_001.o definition of _next_piece in section (__DATA,__common)
collect2: ld returned 1 exit status


Ok I see what you mean now. I don't know how it can say that though, because I checked on some of these things, and I didn't define any of these symbols in tile_init_001.cpp like it says I did. So what does it mean?


It means you're defining a variable in a header file, and then including that header file from three source files, so you end up defining it three times.  And you're doing this for three globals, so you get nine errors.

Move your definitions to one and only one .cpp file.

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

  • Follow-Ups:
    • Re: Weird error situation
      • From: Adam <email@hidden>
References: 
 >Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)

  • Prev by Date: Re: Weird error situation
  • Next by Date: Re: Weird error situation
  • Previous by thread: Re: Weird error situation
  • Next by thread: Re: Weird error situation
  • Index(es):
    • Date
    • Thread