<sarcasm>I love it when we're left to guess how you're calling the function.</sarcasm>
The fact that I know what the problem is without looking at your code is evidence of my awesomeness.
Ehem. Anyway.
substr() is not a static method, so it needs to be called from an std::string: