error: 'ping' was not declared in this scope

not sure what exactly is the problem:

Exactly the same as with the ping() function. You have to do more than provide a function prototype. You have to actually implement the function.