What could cause a "use of undefined type error" when setting up locomotion for a VR character?

I’m trying to add smooth locomotion to the VR Expansion plugin in c++.

when I add the below line I get the error:

code:
AddMovementInput(LeftMotionController->GetForwardVector(), Val);

error:
C2027: use of undefined type ‘UGripMotionControllerComponent’

from googling it seems like maybe it’s related to includes. I’ve tried adding #include “MotionControllerComponent.h” to the .cpp and .h files. Any ideas appreciated.

LeftMotionController is defined in the grandparent class which I’ve also tried including.

If I create a blueprint copy of the c++ class I can see the components including LeftMotionController (as well as something called VRProxy.

Thanks!

In case anyone comes across this in the future, the fix was to add the below line to the .cpp file:

#include “GripMotionControllerComponent.h”