The new 1.0.2 is showing some thing about undefined reference to `setup'

I’m getting undefined reference to `setup’
But I don’t see why using 1.0.2 ide

const int keyMin = 0;      // Keymin, discovered through experiment
const int keyMax = 600;    // keymax, discovered through experiment
void loop() {
  // read the sensor:
  int key = analogRead(A0);
  // map the sensor range to a range of four options:
  int keyValue = map(key, keyMin, keyMax, 0, 3);

  // do something different depending on the 
  // range value:
  switch (keyValue) {
  case 0:    // your hand is on the sensor
    Serial.println("button1");
    break;
  case 1:    // your hand is close to the sensor
    Serial.println("button2");
    break;
  case 2:    // your hand is a few inches from the sensor
    Serial.println("button3");
    break;
  case 3:    // your hand is nowhere near the sensor
    Serial.println("button4t");
    break;
  } 
  delay(1);        // delay in between reads for stability
}

An Arduino sketch requires to define a setup' function, even when it is empty. Such function is used for setting up things you may use on theloop' function. Since you use the Serial object, it is a good idea to initialize it on the `setup' function. Just add this to your code:

void setup() {
  Serial.begin(9600);
}

Dang that did the job I had that in there but I removed it some how Thanks

If you follow the links in the playground you can find the code that the IDE adds.

In this case it adds main() which is required for all C/C++ programs.

main() looks like this

void main(){
  init(); // do things to set up every thing for all programs
  setup();
  while(1==1){
     loop();
  }
}

hence the need to provide both loop() and setup();

Mark