user20771: Try verifying the code to see the errors.  This is on a arduino nano with a 328 processor.  I put the necessary library in the code.
Pastebin for code
 #ifndef Pushbutton_h 
#define Pushbutton_h 


#include <Arduino.h> 


#define PULL_UP_DISABLED    0 
#define PULL_UP_ENABLED     1 


#define DEFAULT_STATE_LOW   0 
#define DEFAULT_STATE_HIGH  1 


/*! \brief The pin used for the button on the 
 * [Zumo Shield for Arduino](http://www.pololu.com/product/2504). 
 * 
 * This does not really belong here in this general pushbutton library and will 
 * probably be removed in the future. */ 
#define ZUMO_BUTTON 12 


class PushbuttonStateMachine 
{ 
public: 
  PushbuttonStateMachine(); 
  bool getSingleDebouncedRisingEdge(bool value); 
private: 
  uint8_t state; 
  uint16_t prevTimeMillis; 
}; 


class PushbuttonBase 
{ 
public: 


  PushbuttonBase(); 


  // wait for button to be pressed, released, or pressed and released 
  void waitForPress(); 
  void waitForRelease(); 
  void waitForButton(); 


  // more complex functions that return true once for each button transition 
  // from released to pressed or pressed to released 
  bool getSingleDebouncedPress(); 
  bool getSingleDebouncedRelease(); 

  // indicates whether button is currently pressed 
  bool isPressed(); 


  // Initializes I/O pin for use as button input. 
  // This gets called automatically so normally you will not need to call this, 
  // but it might be useful if the pin for the button is in the wrong state. 
  virtual void init2() = 0; 


protected: 


  virtual bool _isPressed() = 0; 


private: 


  PushbuttonStateMachine pressState; 
  PushbuttonStateMachine releaseState; 
  bool initialized; 


  // TODO: move all this init stuff down into Pushbutton 
  inline void init() 
  { 
    if (!initialized) 
    { 
      initialized = true; 
      init2(); 
    } 
  } 
}; 


/* \class Pushbutton Pushbutton.h 
 * \brief Interface with pushbuttons on dedicated pins. 
 * 
 */ 
class Pushbutton : public PushbuttonBase 
{ 
public: 


  // constructor; takes arguments specifying whether to enable internal pull-up 
  // and the default state of the pin that the button is connected to 
  Pushbutton(uint8_t pin, uint8_t pullUp = PULL_UP_ENABLED, 
      uint8_t defaultState = DEFAULT_STATE_HIGH); 

  virtual void init2(); 


protected: 


  virtual bool _isPressed(); 


private: 


   uint8_t _pin; 
   bool _pullUp; 
   bool _defaultState; 
 }; 

 #endif 





// PIN Configurations #define SEARCH_SPEED 255 

#define echoPin A0 
#define triggerPin 3 
#define rightBackMotor 4 
#define rightMotorSpeed 10 
#define leftMotorSpeed 9 
#define leftForwardMotor 7  //if a motor goes backward swap the number on the FwdPin and BckPin 
#define rightForwardMotor 8   //if a motor goes backward swap the number on the FwdPin and BckPin 
#define leftBackMotor 11 
#define LED 13 
#define leftSensor A1 
#define rightSensor A2 
#define IRdriver 6 


// Robot Configuration Parameters 
// Speed range is -255 -> 255 
#define MAX_SPEED 255 
#define QTR_Threshold 500 
#define ATTACK_DISTANCE 25 
#define BACKUP_DISTANCE 4000 
#define SEARCH_SPEED 255


// State variables 
bool isBackup = false; 
int backupTimer = 0; 
long distance = 1000; 
Pushbutton button(ZUMO_BUTTON); 


void setSpeed(int speed, int motor); 


void setup() { 
   Serial.begin(9600); 
   Serial.println("Setup."); 


  pinSetup(); 


   Serial.println("Waiting for button"); 
} 


void loop() { 
   digitalWrite(IRdriver, HIGH); 

  if (button.isPressed()) { 
    // if button is pressed, stop and wait for another press to go again 
    button.waitForRelease(); 
    waitForButtonAndCountDown(); 
 } 


  int leftInput = analogRead(leftSensor); 
  int rightInput = analogRead(rightSensor); 


  if ( isBackup ) { 
    backupTimer = backupTimer + 1; 
    setSpeed(-MAX_SPEED, 0); 
    setSpeed(-MAX_SPEED + 20, 1); 
    if (backupTimer >= BACKUP_DISTANCE ) { 
      isBackup = false; 
      backupTimer = 0; 
    } 
  } else { 
    if ( leftInput <= 500 || rightInput <= 500 ) { // WHITE LINE ABORT! 
      //Serial.println("Abort! - "); Serial.println(leftInput); Serial.println(rightInput); 
      isBackup = true; 
      setSpeed(-MAX_SPEED, 0); 
      setSpeed(-MAX_SPEED, 1); 
    } else { 
      distance = getDistance(); 
      if ( distance <= ATTACK_DISTANCE ) { // ATTACK! 
        Serial.println("Attack!"); 
        setSpeed(MAX_SPEED, 0); 
        setSpeed(MAX_SPEED, 1); 
      } else { // search 
        // TODO(erh): implement other searching algorithms 
        Serial.println("Search");  
        setSpeed(SEARCH_SPEED, 0);
        setSpeed(-SEARCH_SPEED, 1); 
      } 
    } 
  } 
} 


void pinSetup() { 
  // motors! 
  pinMode(leftMotorSpeed, OUTPUT); 
  pinMode(rightMotorSpeed, OUTPUT); 
  pinMode(leftForwardMotor, OUTPUT); 
  pinMode(leftBackMotor, OUTPUT); 
  pinMode(rightForwardMotor, OUTPUT); 
  pinMode(rightBackMotor, OUTPUT); 

   // sonar sensor 
  pinMode(LED, HIGH); 
  pinMode(triggerPin, OUTPUT); 
  pinMode(echoPin, INPUT); 


  // qtr light sensor 
  pinMode(leftSensor, INPUT); 
  pinMode(rightSensor, INPUT); 
  pinMode(IRdriver, OUTPUT); 
} 


void setSpeed(int speed, int motor = 0) { 
  int speedPin, forwardPin, backPin; 
  if ( motor == 0 ) { 
    speedPin = leftMotorSpeed; 
    forwardPin = leftForwardMotor; 
    backPin = leftBackMotor; 
  } else if ( motor == 1 ) { 
    speedPin = rightMotorSpeed; 
    forwardPin = rightForwardMotor; 
    backPin = rightBackMotor; 
  } 


  if ( speed == 0 ) { 
    analogWrite(speedPin, 0); 
    digitalWrite(forwardPin, LOW); 
    digitalWrite(backPin, LOW); 
  } else if ( speed > 0 ) { 
    digitalWrite(forwardPin, HIGH); 
    digitalWrite(backPin, LOW); 
    analogWrite(speedPin, speed); 
  } else if ( speed < 0 ) { 
    digitalWrite(forwardPin, LOW); 
    digitalWrite(backPin, HIGH); 
    analogWrite(speedPin, abs(speed)); 
  } 
} 


long getDistance() { 
  long duration, distance; 
  digitalWrite(triggerPin, LOW);  // Added this line 
  delayMicroseconds(2); // Added this line 
  digitalWrite(triggerPin, HIGH); 
  delayMicroseconds(10); // Added this line 
  digitalWrite(triggerPin, LOW); 
  duration = pulseIn(echoPin, HIGH); 
  distance = (duration/2) / 29.1; 
  return distance; 
} 


void waitForButtonAndCountDown() { 
  digitalWrite(LED, HIGH); 
  button.waitForButton(); 
  digitalWrite(LED, LOW); 


  for (int i = 0; i < 3; i++ ) { 
    Serial.println(i); 
    delay(1000); 
  } 


  delay(1000); 
  Serial.println("ATTACK!"); 
  delay(1000); 
}


user20711: Your code contains only the header declarations (.h file) for those classes. There should also be another file (probably .cpp) that actually implements the code for the classes.
What you pasted looks very similar to the Pushbutton stuff in this project on GitHub.
You can look at their Pushbutton.h and Pushbutton.cpp files to get an idea of what I mean. In fact, you might be able to use those files instead of what you have. I can verify that it does compile, but not whether it works or not.

20771: <p>Try verifying the code to see the errors.  This is on a arduino nano with a 328 processor.  I put the necessary library in the code.
<a href="http://pastebin.com/TbTJQfBn" rel="nofollow">Pastebin for code</a></p>

<pre><code> #ifndef Pushbutton_h 
#define Pushbutton_h 


#include &lt;Arduino.h&gt; 


#define PULL_UP_DISABLED    0 
#define PULL_UP_ENABLED     1 


#define DEFAULT_STATE_LOW   0 
#define DEFAULT_STATE_HIGH  1 


/*! \brief The pin used for the button on the 
 * [Zumo Shield for Arduino](http://www.pololu.com/product/2504). 
 * 
 * This does not really belong here in this general pushbutton library and will 
 * probably be removed in the future. */ 
#define ZUMO_BUTTON 12 


class PushbuttonStateMachine 
{ 
public: 
  PushbuttonStateMachine(); 
  bool getSingleDebouncedRisingEdge(bool value); 
private: 
  uint8_t state; 
  uint16_t prevTimeMillis; 
}; 


class PushbuttonBase 
{ 
public: 


  PushbuttonBase(); 


  // wait for button to be pressed, released, or pressed and released 
  void waitForPress(); 
  void waitForRelease(); 
  void waitForButton(); 


  // more complex functions that return true once for each button transition 
  // from released to pressed or pressed to released 
  bool getSingleDebouncedPress(); 
  bool getSingleDebouncedRelease(); 

  // indicates whether button is currently pressed 
  bool isPressed(); 


  // Initializes I/O pin for use as button input. 
  // This gets called automatically so normally you will not need to call this, 
  // but it might be useful if the pin for the button is in the wrong state. 
  virtual void init2() = 0; 


protected: 


  virtual bool _isPressed() = 0; 


private: 


  PushbuttonStateMachine pressState; 
  PushbuttonStateMachine releaseState; 
  bool initialized; 


  // TODO: move all this init stuff down into Pushbutton 
  inline void init() 
  { 
    if (!initialized) 
    { 
      initialized = true; 
      init2(); 
    } 
  } 
}; 


/* \class Pushbutton Pushbutton.h 
 * \brief Interface with pushbuttons on dedicated pins. 
 * 
 */ 
class Pushbutton : public PushbuttonBase 
{ 
public: 


  // constructor; takes arguments specifying whether to enable internal pull-up 
  // and the default state of the pin that the button is connected to 
  Pushbutton(uint8_t pin, uint8_t pullUp = PULL_UP_ENABLED, 
      uint8_t defaultState = DEFAULT_STATE_HIGH); 

  virtual void init2(); 


protected: 


  virtual bool _isPressed(); 


private: 


   uint8_t _pin; 
   bool _pullUp; 
   bool _defaultState; 
 }; 

 #endif 





// PIN Configurations #define SEARCH_SPEED 255 

#define echoPin A0 
#define triggerPin 3 
#define rightBackMotor 4 
#define rightMotorSpeed 10 
#define leftMotorSpeed 9 
#define leftForwardMotor 7  //if a motor goes backward swap the number on the FwdPin and BckPin 
#define rightForwardMotor 8   //if a motor goes backward swap the number on the FwdPin and BckPin 
#define leftBackMotor 11 
#define LED 13 
#define leftSensor A1 
#define rightSensor A2 
#define IRdriver 6 


// Robot Configuration Parameters 
// Speed range is -255 -&gt; 255 
#define MAX_SPEED 255 
#define QTR_Threshold 500 
#define ATTACK_DISTANCE 25 
#define BACKUP_DISTANCE 4000 
#define SEARCH_SPEED 255


// State variables 
bool isBackup = false; 
int backupTimer = 0; 
long distance = 1000; 
Pushbutton button(ZUMO_BUTTON); 


void setSpeed(int speed, int motor); 


void setup() { 
   Serial.begin(9600); 
   Serial.println("Setup."); 


  pinSetup(); 


   Serial.println("Waiting for button"); 
} 


void loop() { 
   digitalWrite(IRdriver, HIGH); 

  if (button.isPressed()) { 
    // if button is pressed, stop and wait for another press to go again 
    button.waitForRelease(); 
    waitForButtonAndCountDown(); 
 } 


  int leftInput = analogRead(leftSensor); 
  int rightInput = analogRead(rightSensor); 


  if ( isBackup ) { 
    backupTimer = backupTimer + 1; 
    setSpeed(-MAX_SPEED, 0); 
    setSpeed(-MAX_SPEED + 20, 1); 
    if (backupTimer &gt;= BACKUP_DISTANCE ) { 
      isBackup = false; 
      backupTimer = 0; 
    } 
  } else { 
    if ( leftInput &lt;= 500 || rightInput &lt;= 500 ) { // WHITE LINE ABORT! 
      //Serial.println("Abort! - "); Serial.println(leftInput); Serial.println(rightInput); 
      isBackup = true; 
      setSpeed(-MAX_SPEED, 0); 
      setSpeed(-MAX_SPEED, 1); 
    } else { 
      distance = getDistance(); 
      if ( distance &lt;= ATTACK_DISTANCE ) { // ATTACK! 
        Serial.println("Attack!"); 
        setSpeed(MAX_SPEED, 0); 
        setSpeed(MAX_SPEED, 1); 
      } else { // search 
        // TODO(erh): implement other searching algorithms 
        Serial.println("Search");  
        setSpeed(SEARCH_SPEED, 0);
        setSpeed(-SEARCH_SPEED, 1); 
      } 
    } 
  } 
} 


void pinSetup() { 
  // motors! 
  pinMode(leftMotorSpeed, OUTPUT); 
  pinMode(rightMotorSpeed, OUTPUT); 
  pinMode(leftForwardMotor, OUTPUT); 
  pinMode(leftBackMotor, OUTPUT); 
  pinMode(rightForwardMotor, OUTPUT); 
  pinMode(rightBackMotor, OUTPUT); 

   // sonar sensor 
  pinMode(LED, HIGH); 
  pinMode(triggerPin, OUTPUT); 
  pinMode(echoPin, INPUT); 


  // qtr light sensor 
  pinMode(leftSensor, INPUT); 
  pinMode(rightSensor, INPUT); 
  pinMode(IRdriver, OUTPUT); 
} 


void setSpeed(int speed, int motor = 0) { 
  int speedPin, forwardPin, backPin; 
  if ( motor == 0 ) { 
    speedPin = leftMotorSpeed; 
    forwardPin = leftForwardMotor; 
    backPin = leftBackMotor; 
  } else if ( motor == 1 ) { 
    speedPin = rightMotorSpeed; 
    forwardPin = rightForwardMotor; 
    backPin = rightBackMotor; 
  } 


  if ( speed == 0 ) { 
    analogWrite(speedPin, 0); 
    digitalWrite(forwardPin, LOW); 
    digitalWrite(backPin, LOW); 
  } else if ( speed &gt; 0 ) { 
    digitalWrite(forwardPin, HIGH); 
    digitalWrite(backPin, LOW); 
    analogWrite(speedPin, speed); 
  } else if ( speed &lt; 0 ) { 
    digitalWrite(forwardPin, LOW); 
    digitalWrite(backPin, HIGH); 
    analogWrite(speedPin, abs(speed)); 
  } 
} 


long getDistance() { 
  long duration, distance; 
  digitalWrite(triggerPin, LOW);  // Added this line 
  delayMicroseconds(2); // Added this line 
  digitalWrite(triggerPin, HIGH); 
  delayMicroseconds(10); // Added this line 
  digitalWrite(triggerPin, LOW); 
  duration = pulseIn(echoPin, HIGH); 
  distance = (duration/2) / 29.1; 
  return distance; 
} 


void waitForButtonAndCountDown() { 
  digitalWrite(LED, HIGH); 
  button.waitForButton(); 
  digitalWrite(LED, LOW); 


  for (int i = 0; i &lt; 3; i++ ) { 
    Serial.println(i); 
    delay(1000); 
  } 


  delay(1000); 
  Serial.println("ATTACK!"); 
  delay(1000); 
}
</code></pre>
 20711: <p>Your code contains only the header declarations (<code>.h</code> file) for those classes. There should also be another file (probably <code>.cpp</code>) that actually implements the code for the classes.</p>

<p>What you pasted looks very similar to the <code>Pushbutton</code> stuff in <a href="https://github.com/pololu/a-star-32u4-arduino-library" rel="nofollow">this project on GitHub</a>.</p>

<p>You can look at their <code>Pushbutton.h</code> and <code>Pushbutton.cpp</code> files to get an idea of what I mean. In fact, you might be able to use those files instead of what you have. I can verify that it does compile, but not whether it works or not.</p>
