Forward declaration causes compile error on VS Community 2019

I tried to use the forward declaration for the UCapsuleComponent in VS Community 2019 but this would give a compile error on RootComponent=CapsuleComp. The error Message said ‘UCapsuleComponent * could not be converted to USceneComponent *’. Including the header file for UCapsuleComponent worked without any further changes. Perhaps it is also related to using UE 4.26.1.

Edit: I just needed to watch a bit further. The header file got included in the .cpp file later in the video.

1 Like

Privacy & Terms