• 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: I'm quite confused...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I'm quite confused...


  • Subject: Re: I'm quite confused...
  • From: Laurence Harris <email@hidden>
  • Date: Sat, 22 Sep 2007 01:56:33 -0400


On Sep 22, 2007, at 1:18 AM, Adam wrote:


On Sep 21, 2007, at 9:59 PM, Chris Espinosa wrote:


On Sep 21, 2007, at 9:53 PM, Adam wrote:

Declared but not defined? The first and last ones are classes, and the middle one is an int array. Hmm... I declared them all and then I almost immediately define them. : (

I added the flag to "Other Linker Flags" and it didn't do anything AFAIK. : (

I haven't added or removed any files since I successfully built this last.

You're going to have to show us some source code, I'm afraid. The linker disagrees with you, and without seeing what the compiler has been given it's hard to know why.


Chris

//inside my header file class c_piece { public: //Declarations (aka int x;) c_piece() { //Definitions (aka x = 0;) } };

extern c_piece curr_piece;
extern c_piece next_piece;

extern int arr_tetris_screen[SCREENW] [SCREENH + 1];

[...]

How is that not defining it?

Because an extern declaration doesn't declare anything. extern says it's declared somewhere else so the compiler won't complain, but if the linker can't find the actual definition at link time you'll get the error you're seeing. If you have the following in your header file:


extern c_piece curr_piece;

Then you need the following in a source file somewhere:

c_piece curr_piece;

BTW, in the future try to use a subject describes the problem, not your state of mind, so people can determine from reading it if the nature of the message is of interest to them. ;-)

Larry

_______________________________________________
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: 
 >I'm quite confused... (From: Adam <email@hidden>)
 >Re: I'm quite confused... (From: Chris Espinosa <email@hidden>)
 >Re: I'm quite confused... (From: Adam <email@hidden>)
 >Re: I'm quite confused... (From: Chris Espinosa <email@hidden>)
 >Re: I'm quite confused... (From: Adam <email@hidden>)

  • Prev by Date: Re: Executing Shell Scripts using XCode
  • Next by Date: Re: I'm quite confused...
  • Previous by thread: Re: I'm quite confused...
  • Next by thread: Re: I'm quite confused...
  • Index(es):
    • Date
    • Thread