USplineComponent not setting as the RootComponent of th Actor

I am creating Pipes Generating tool based on USplineComponent. For that I have to set the USplineComponent as the Root Component of my Actor based GenPipe class. I have tried this:

//GenPipe.cpp
AGenPipe::AGenPipe()   //..The Constuctor
{
   splineComponent = CreateDefaultSubobject<USplineComponent>(TEXT("Spline Component"));
   RootComponent = splineComponent;   //..Problematic Assignment
}

The splineComponent is declared in like this:

//somewhere in GenPipe.h
private:
   class USplineComponent* splineComponent;

But when I compile, It gives me compilation error:

//Error after compilation

error C2440: '=': cannot convert from 'USplineComponent *' to 'USceneComponent * '
note:Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast.

Any help will be appreciated.

#include “Components/SplineComponent.h”

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = SomeCategory, meta = (AllowPrivateAccess = "true"))
class USplineComponent* splineComponent;

SetRootComponent(splineComponent);

I Tried the solution but getting same kind of errors:

error C2664: 'bool AActor::SetRootComponent(USceneComponent *)': cannot convert argument 1 from 'USplineComponent *' to 'USceneComponent *'

    note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

[Solved]

I Solved the problem by myself.
I was not including header for spline component.

#include <Runtime/Engine/Classes/Components/SplineComponent.h>

After including the header, It worked.