Pointer to Incomplete Class, included everything needed

Hi, I’m following along with this tutorial: Unreal Engine C++ Tutorial - Episode 2: Pickups - YouTube but I’m getting an error “pointer to incomplete class” when trying to assign a static mesh to a root object via the SetupAttachment function, I’ve included #include "Components/ShapeComponent.h", #include "Components/SceneComponent.h", and #include "Components/StaticMeshComponent.h" already and it seems to compile fine but the error still shows.

Pickup.h:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Components/BoxComponent.h"
#include "Components/ShapeComponent.h"
#include "Components/SceneComponent.h"
#include "Components/StaticMeshComponent.h"
#include "Pickup.generated.h"

UCLASS()
class YT_API APickup : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	APickup();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UPROPERTY(EditAnywhere)
	USceneComponent* PickupRoot;

	// The static mesh for the pickup
	UPROPERTY(EditAnywhere)
	UStaticMeshComponent* PickupMesh;
	
	UPROPERTY(EditAnywhere)
	UShapeComponent* PickupBox;

	UFUNCTION()
	void OnPlayerEnterPickupBox(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

};

Pickup.cpp:

// Fill out your copyright notice in the Description page of Project Settings.

#include "Pickup.h"

// Sets default values
APickup::APickup() {
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	PickupRoot = CreateDefaultSubobject<USceneComponent>(TEXT("PickupRoot"));
	RootComponent = PickupRoot;

	PickupMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyMesh"));
	PickupMesh->SetupAttachment(PickupRoot);


}

// Called when the game starts or when spawned
void APickup::BeginPlay() {
	Super::BeginPlay();
	
}

// Called every frame
void APickup::Tick(float DeltaTime) {
	Super::Tick(DeltaTime);

}

void APickup::OnPlayerEnterPickupBox(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult) {
	Destroy();
}

Also sometimes when I make a change to a source file I get a long spew of errors saying everything is undefined, anyone have any idea whats up with that? I’m using VS Community 2017 if that helps.

Don’t look too much are Visual studio error panel, it’s often miss leading, try compile and look at VS output log, if generation succeed you are good !

Sometime restarting vs help cleaning “errors” but i really often get some that are not real. ( same for intelissense underlining )

Hey, you can also check out this explanation, at the end of the post I gave a brief explanation why Intellisense is giving you wrong underlinings! <3

Hey, do you still have questions? Otherwise it would be great if you hit the resolve button! <3