That's not a compiler error, it compiled just fine. That's a runtime error.

Also, I don't understand why you put your function prototype for StdDevFunc() inside the run() body. Move it to prior. Or just move the actual function above it and remove the prototype.