Pointer to incomplete class is not allowed on UInputComponent pointer in class derived from ACharacter

Since you are in the .cpp file you do not declare forward with the “class” just leave it out. And of cource include InputComponent in the .cpp file.