Newbie question: Undefined references

My son and I were trying to do this basic tutorial:

Tone: play a melody with a Piezo speaker. from here: http://arduino.cc/en/Tutorial/Tone

We copied code right from the tutorial but get this message when trying to verify:

core.a(main.cpp.o): In function main': /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:7: undefined reference tosetup' /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:10: undefined reference to `loop'

Help please! =( :0

did you paste that note file into a seperate tab like it said properly? If so and it still doesn’t work then try reinstalling the arduino software.

I hope you get it working because it’s very fun to play around with the notes once you get the hang of it, I made mine play here comes the sun by actually finding the notes on my guitar and then pasting them in note by note.

If you get it working heres the code for here comes the sun

/*
  Melody
 
 Plays a melody
 
 circuit:
 * 8-ohm speaker on digital pin 8
 
 created 21 Jan 2010
 modified 14 Oct 2010
 by Tom Igoe

This example code is in the public domain.
 
 http://arduino.cc/en/Tutorial/Tone
 
 */
 #include "pitches.h"

// notes in the melody:
int melody[] = {
  NOTE_CS5, NOTE_A4, NOTE_B4, NOTE_CS5,0, NOTE_A4 ,0, NOTE_CS5, NOTE_B4, NOTE_A4,NOTE_FS4, NOTE_A4, NOTE_B4,NOTE_A4, NOTE_FS4,NOTE_GS4,NOTE_FS4,NOTE_GS4,NOTE_A4,NOTE_B4,0,
  NOTE_CS5, NOTE_A4, NOTE_B4, NOTE_CS5,0, NOTE_A4 ,0, NOTE_CS5, NOTE_B4, NOTE_A4,NOTE_FS4,0,NOTE_CS5,NOTE_B4,NOTE_A4,NOTE_GS4,};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
  4,4,4,4,4,2,4,4,2,2,2,2,2,2,4,4,4,4,2,2,2,4,4,4,4,4,2,4,4,2,2,2,4,4,2,2,1, };

void setup() {
  // iterate over the notes of the melody:
  for (int thisNote = 0; thisNote < 37; thisNote++) {

    // to calculate the note duration, take one second
    // divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int noteDuration = 1000/noteDurations[thisNote];
    tone(8, melody[thisNote],noteDuration);

    // to distinguish the notes, set a minimum time between them.
    // the note's duration + 30% seems to work well:
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    // stop the tone playing:
    noTone(8);
  }
}

void loop() {
  // no need to repeat the melody.
}

make sure you have that pitches.h tab in there too.