Unrecognized Enum in Header

I’ve declared an enum like so

EquippableItem.h

#pragma once

#include "CoreMinimal.h"
#include "Item.h"
#include "EquippableItem.generated.h"

UENUM(BlueprintType)
enum class EEquippableSlot : uint8
{
	EIS_Head UMETA(DisplayName = "Head"),
	EIS_Helmet UMETA(DisplayName = "Helmet"),
    ...
};

Whenever I try to access this enum in another header file ie

Character.h

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
// #include "Items/EquippableItem.h"
#include "SurvivalCharacter.generated.h"

UCLASS()
class SURVIVALGAME_API APlayerCharacter : public ACharacter
{
GENERATED_BODY()

public:

    ASurvivalCharacter();

    UPROPERTY(BlueprintReadOnly, Category = Mesh)
    TMap<EEquippableSlot, USkeletalMeshComponent*> PlayerMeshes;
}

I get an Error: Unrecognized type 'EEquippableSlot' - type must be a UCLASS, USTRUCT or UENUM
unless I directly #include "EquippableItem.h" in the header file.
It’s my understanding that I shouldn’t have to include the header in the header file (nor is this desired) unless I’m accessing the values in the enum. I’ve already included the item file in the Character.cpp. Why can’t I access the enum type?

You need to include the header in which you declared the Enumerator. :slight_smile: