Passing object of type "Print" into function

I am using this library in my code: and one of the functions I need to use is called setOut(), which sets the output of the Lua interpreter to a Print type object:

// from the library header file
void setOut(Print* p) { out = p; };

I have made a custom class that implements the Print class to handle the output of the Lua interpreter like so:

class Terminal : public Print {
    size_t write(uint8_t a) {
      //custom print function
    // private stuf
Terminal term;

But when I try to pass it into the setOut function I get an error:

no matching function for call to 'Lua::setOut(Terminal&)'

How can I pass “term” as a “Print” type object so that any output from Lua gets passed to the Terminal object?
Btw I am using a Feather M4


Thanks, that worked