An error occurs when declaring a custom class.

#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "BM_InventoryStructure.h"
#include "BM_InventoryContainer.h"
#include "BM_InventoryComponent.generated.h"


UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class UBM_InventoryComponent : public UActorComponent
{
	GENERATED_BODY()

public:	
	// Sets default values for this component's properties
	UBM_InventoryComponent();

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

public:	
	// Called every frame
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

	void SlotCheck(FKey& key);
	void AddToInventory(FST_InventoryCPP CollectedItemInformation);
	void UseItem(int32 SelectedIndex, const FText& ItemName, bool bSelected);

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FST_InventoryCPP> Inventory;
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UBM_InventoryContainer> InventoryClass;

};
#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Components/WrapBox.h"
#include "InventoryCPP/BM_InventoryStructure.h"
#include "BM_InventorySlot.h"
#include "BM_InventoryContainer.generated.h"

/**
 * 
 */
UCLASS()
class UBM_InventoryContainer : public UUserWidget
{
	GENERATED_BODY()
	
protected:
	UPROPERTY(EditAnywhere,BlueprintReadWrite)
	TArray<FST_InventoryCPP> Inventory;

private:
	/*UPROPERTY(EditAnywhere,BlueprintReadWrite,meta = (AllowPrivateAccess = "true"))
	int32 Index;*/
protected:
	virtual void NativeConstruct();

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UBM_InventorySlot> InventorySlotClass;


public:
	UFUNCTION(BlueprintCallable)
	void SetGrid();
	
public:
	UPROPERTY()
	UBM_InventoryComponent* InventoryREF;
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 SelectedIndex;
	UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
	class UWrapBox* GridBox;
};

#include "InventoryCPP/BM_InventoryContainer.h"
#include "InventoryCPP/BM_InventorySlot.h"
#include <BM_Character.h>

void UBM_InventoryContainer::NativeConstruct()
{
	Super::NativeConstruct();

	UE_LOG(LogTemp, Warning, TEXT("sdsd"));

	APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); // Get Player Character 함수 
	if (PlayerController != nullptr)
	{
		ABM_Character* BM_Character = Cast<ABM_Character>(PlayerController->GetCharacter());
		if (BM_Character != nullptr)
		{
			InventoryREF = Cast<UBM_InventoryComponent>(BM_Character->GetComponentByClass(UBM_InventoryComponent::StaticClass()));
			SetGrid();
		}
	}
}

void UBM_InventoryContainer::SetGrid()
{
	this->Inventory = InventoryREF->Inventory;
	int32 Index = 0;
	GridBox = Cast<UWrapBox>(GetWidgetFromName(TEXT("GridBox")));
	if (GridBox != nullptr)
	{
		GridBox->ClearChildren();
	}

	for (FST_InventoryCPP subInventory : Inventory)
	{
		UBM_InventorySlot* SlotWidget = CreateWidget<UBM_InventorySlot>(GetWorld(), InventorySlotClass);
		//SlotWidget->SetIndexCPP(Index);
		if (SlotWidget != nullptr)
		{
			GridBox->AddChildToWrapBox(SlotWidget);
			UE_LOG(LogTemp, Warning, TEXT("Add Slot To Container"));
			// 색깔 바뀌는거 추가해야하는 부분
		}
	}
	UE_LOG(LogTemp, Warning, TEXT("Complete"));
	
}

In order from top to bottom, UBM_InventoryComponent.h, UBM_InventoryContainer.h,
This is the UBM_InventoryContainer.cpp file.

The problem is that when you declare UBM_InventoryComponent* InventoryREF in InventoryContainer.h and then receive the value from the Construct part in the cpp file and try to use it in the SetGrid() function, an error occurs in the variable declaration part.

It is error text.
[4/8] Compile [x64] BM_InventoryContainer.gen.cpp
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C2143: syntax error: missing ‘;’ before ‘
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C2238: unexpected token(s) preceding ‘;’
D:\GitHubData\UE\BangMoonTest\Intermediate\Build\Win64\UnrealEditor\Inc\BangMoon\UHT\BM_InventoryContainer.gen.cpp(132): error C2039: ‘InventoryREF’: is not a member of ‘UBM_InventoryContainer’
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(16): note: see declaration of ‘UBM_InventoryContainer’
D:\GitHubData\UE\BangMoonTest\Intermediate\Build\Win64\UnrealEditor\Inc\BangMoon\UHT\BM_InventoryContainer.gen.cpp(132): error C2618: illegal member designator in offsetof
D:\GitHubData\UE\BangMoonTest\Intermediate\Build\Win64\UnrealEditor\Inc\BangMoon\UHT\BM_InventoryContainer.gen.cpp(132): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
[5/8] Compile [x64] BM_InventoryContainer.cpp
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C2143: syntax error: missing ‘;’ before '

D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.h(41): error C2238: unexpected token(s) preceding ‘;’
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.cpp(20): error C2065: ‘InventoryREF’: undeclared identifier
D:\GitHubData\UE\BangMoonTest\Source\BangMoon\Private\InventoryCPP\BM_InventoryContainer.cpp(28): error C2065: ‘InventoryREF’: undeclared identifier