what I have always done is put the class definition is a separate file like you apparently have already called libprint.cpp and then in the main.cpp file, at the top I would #include "libprint.cpp"
Basically, the main.cpp would look like this:
Code:
#include "libprint.cpp"
int main(){
print InstanceOfPrint; // declares a variable or instance of the print class
InstanceOfPrint.print; // calls the print() method of the print class
}
however, you might consider renaming the method in the libprint file to something else as having a method the same name as the class makes the method the default constructor in this case