? Either you have it or you don't have it. Do you have the class with the function coded? Did you put it in a header file? Did you #include the header file in the cpp?
Your question is a tad vague.
If you have the class and you can call it from int main() while the class is in the cpp, then simply move the class to a header file then #include it and call it.