StaticClass Identifier not found

Hi,

I have a class drived from the empty class and I get to errors which I can’t fixe:

201575-unbenannt.png

may be you could help me in some way is my question is unclear or I didn’t provieded enought info please give me feed back.

Thanks a lot for any help : D

here is my sorce code:
.h

#pragma once

#include "CoreMinimal.h"

struct FItem
{	

public:
	FItem();
	
	int GetType();
	bool Valid();

	TArray<uint32> stats;

};


class ERUNE_API Inventory
{
public:
	Inventory();
	~Inventory();
	
	// set the size of array only once
	//void SetSizeInv(int size);
	void SetSizeInv(int size);
	// add a item to the list
	int AddItemInv(FItem item);
	// delets a itme at the index
	void DeleteItemInv(int index);
	// get item at position
	FItem GetItemInv(int index);
	
private:
	TArray<FItem> inv;
	int size;
	
};

.cpp

#include "Inventory.h"
#include "erune.h"

FItem::FItem()
{
	stats.Add(0);
}
int FItem::GetType()
{
	if (stats.Num() > 0)
	{
		return stats[0] % 10;
	}
	return 0;
}
bool FItem::Valid()
{
	return GetType() == 0;
}

Inventory::Inventory(){ }

Inventory::~Inventory(){ }

int Inventory::AddItemInv(FItem item)
{	
	for (int32 i = 0; i != inv.Num(); i++)
	{
		if (inv[i].GetType())
		{			
			return 0;			
		}			
	}	
	return 1;
}

void Inventory::SetSizeInv(int size)
{	
	if (this->size == 0)
	{
		this->size = size;
		//inv.AddDefaulted(size);		
	}	
}

void Inventory::DeleteItemInv(int index)
{
	inv.InsertDefaulted(index);
}

FItem Inventory::GetItemInv(int index)
{
	if (index < inv.Num())
	{
		return inv[index];
	}
	return FItem();
}

I think you need to identify FItem as a USTRUCT if you want to use it in a TArray. You’ll also want to include the generated header for the inventory class as your final include before the Inventory class

#include "Inventory.generated.h"

USTRUCT()
struct FItem

and the class

UCLASS()
class Inventory

Updated:

It works now, I just deleted the old file and copied the code in a new one.

Old:

Thanks a lot for your answer : )

but, there is no file Inventory.generated.h, I think this is because this doesn’t

inherit from AActor. The USTRUCT() and UCLASS() don’t help they just cause
more errors.

In the auto generated code from a empty c++ class ue 4 doesn’t generates UCLASS() so I shouldn’t need it

I really appreciate that you tried to help and if you have a another Idea I would be happy to hear it : D