In the error message, it says:
error: incomplete type 'godot::InputEvent' used in nested name specifier
You kind of have to work backwards to read compiler errors, so looking at the line before that you see:
game/scripts/Lantern.cpp:6:45 required from here
Which is the 6th line in your Lantern.cpp file.
Essentially what that means is that the compiler needs the definition of the godot::InputEvent type, and it can't find it.
Try
#include<InputEvent.hpp>
in your Lantern.cpp file to see if that fixes it.
As for why this error is happening, I think it's because the register_method
function tries to convert a Variant
into the InputEvent *
you put into your function signature, and in order to do that it has the call the ___get_from_variant
static function on the InputEvent
class, which it can't find.