Annoying pinMode error please help

Please help I keep getting this error and can't figure it out:

//second ping
long duration, inches;
float feet;
pinMode(pingPin2,OUTPUT);
digitalWrite(pingPin2, LOW);
delayMicroseconds(2);
digitalWrite(pingPin2, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin2, LOW);
pinMode(pingPin2, INPUT);
duration = pulseIn(pingPin2, HIGH);

inches = microsecondsToInches(duration);
feet = microsecondsToFeet(duration);

Serial.print(inches);
Serial.print("in, ");
Serial.print(feet);
Serial.print("ft ");
Serial.println();

delay(100);
// put what you want the servo to do based on how many inches away the object is...
if (inches <= 36)
{ servo.write(135);
}

}

long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}

float microsecondsToFeet(long microseconds)
{
return microsecondsToInches(microseconds) / 12;
}

  1. use code tags, not quote tags, for code
  2. WHAT ERROR?
  3. post the entire code, that's a fragment, so we can't even compile it to look at the
    errors you've neglected to report.
    [ thought: if that is the whole sketch, its obviously very broken ]

PingPin2 should be actually set to pin 2 and not just named.
#define pingPin2 2

Or

byte pingPin2 = 2;