26:14: error: statement cannot resolve address of overloaded function

I tried the Crystal Ball project from the Starter Kit book, and I get this error:
26:14: error: statement cannot resolve address of overloaded function
I don't have line numbers in the IDE but it seems to apply to the
"reply=random(8 )" line just at the beginning of the loop function.

A previous forum topic about the same error showed that the error was the line before the line that the poster's debugger flagged, though.

I quadruple-checked the lines involved, both from what I know (not much) about C and from what was printed in the book, and I still can't find the error...

#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);


const int switchPin=10;
int switchState=0;
int prevSwitchState=0;
int reply;

void setup() {
  lcd.begin(16,2);
  pinMode(switchPin, INPUT);
  lcd.print("Ask the");
  lcd.setCursor(0,1);
  lcd.print("Crystal Ball");
}

void loop() {
  switchState = digitalRead(switchPin);
  if (switchState != prevSwitchState) {
      if (switchState == LOW) {
        reply=random(8);
    lcd.clear;
    lcd.setCursor(0,0);
    lcd.print("The ball says:");
    lcd.setCursor(0,1);
    switch(reply) {
      case 0:
      lcd.print("Yes");
      break;
      case 1:
      lcd.print("Most Lilely");
      break;
      case 2:
      lcd.print("Certainly");
      break;
      case 3:
      lcd.print("Outlook good");
      break;
      case 4:
      lcd.print("Unsure");
      break;
      case 5:
      lcd.print("Ask again");
      break;
      case 6:
      lcd.print("Doubtful");
      break;
      case 7:
      lcd.print("No");
      break;
    }
  }
}
prevSwitchState=switchState;
}

I don't have line numbers in the IDE

In a way you do. The lower left of the IDE window will show the line number the cursor is on. Keep moving the cursor until the line number shows line 26.

Which version of the IDE are you using?
In IDE 1.0.6 it highlights the line which contains the error. In this case it highlights the line:

    lcd.clear;

which clearly has a syntax error.

Pete

Thank you very much, that was the problem.
Strangely, the line bearing "lcd.clear;" was line 23.

I use the editor that is in the Debian Wheezy repository, apparently it's 1.0.1

In 1.0.6 the error message starts with "sketch_nov27a:23". Can you update to 1.0.6 on Debian? It would make life a bit easier for you :slight_smile:

Pete

el_supremo:
In 1.0.6 the error message starts with "sketch_nov27a:23". Can you update to 1.0.6 on Debian? It would make life a bit easier for you :slight_smile:

Pete

I have no idea, actually.
Probably it can be done, but not with a clean install (as it's not in the repositories).

Just download the folder from this site, unzip, and run directly from that.