Generated body error

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

#pragma once

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

UCLASS()
class LEARNING_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;

	UPROPERTY(EditAnywhere)
	UStaticMeshComponent* PickupMesh;

	UPROPERTY(EditAnywhere)
	UShapeComponent* PickupBox;

	UFUNCTION()
	void onPlayerEnterPickupBox(
		UPrimitiveComponent* VverlappedComp,
		AActor* OtherActor,
		UPrimitiveComponent* OtherComp,
		int32 OtherBodyIndex,
		bool bFromSweep,
		const FHitResult& SweepResult
	);
	
};

that shows me that GENERATED_BODY() is error.

I had a similar problem when using #include.

The way I fixed it was adding class before whatever I had to use in #include, and in the .cpp file I added the #include.
In your problem here I’d take the

#include "Components/ShapeComponent.h"

in line 5 and move it to the CPP file, and in line 34 change it to

class UShapeComponent* PickupBox

That’s just how I resolved a similar problem, I have no idea if it’s the right way, I’m new to unreal.

was having similar issue with particlesystemcomponent and parictlesystemdefintions. this fixed it thank you. Any good references on what this generated body thing even is? Can’t seem to find much info about it

@Grisnak TBH not really, this is taken from the documentation of UObject:
“The GENERATED_BODY macro takes no arguments, but sets up the class to support the infrastructure required by the engine. It is required for all UCLASSes. Note that the GENERATED_BODY macro sets the member access level to “public” rather than the language default of “private” in the current version of the engine.” Except that I take this as granted, it has something to do with the basic infrastructure of Unreal’s classes.