This line is the issue:
const int pingdelay=50 // milliseconds delay added prior to a ping
You're missing a semi-colon
The mangling the IDE does to your sketch is apparently causing the wrong line to be blamed.
This line is the issue:
const int pingdelay=50 // milliseconds delay added prior to a ping
You're missing a semi-colon
The mangling the IDE does to your sketch is apparently causing the wrong line to be blamed.