Need to identify what's wrong

I have defined a struct that actually exists in the UE (Unreal Engine) editor, its representation is in the form of a file. And now I want to reference it in C++ code using a pointer.

To do this, I used the following definition in the header file:

USTRUCT(BlueprintType)
struct FItemStatRow
{
	GENERATED_BODY()
};

UCLASS(Blueprintable, Category = "DataDriven")
class DATAASSET_API UMyDataFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UMyDataFunctionLibrary();

	static FItemStatRow* MyStructPtr;
}

I have written the following code in the source file:

FItemStatRow* UMyDataFunctionLibrary::MyStructPtr = nullptr;

UMyDataFunctionLibrary::UMyDataFunctionLibrary() {
	static ConstructorHelpers::FObjectFinder<UClass> StructFinder(TEXT("UserDefinedStruct'/Game/DataTable/PrepareData/S_ItemStatRow.S_ItemStatRow'"));
	if (StructFinder.Succeeded()) {
		UClass* StructClass = StructFinder.Object;
		/*if (StructClass) {
			MyStructPtr = Cast<FItemStatRow>(StructClass->GetDefaultObject());
		}*/
	}
}

The commented-out portion that I have is unable to compile, and I’m not sure what the issue is or how to fix it.
The error message specifically states that “StaticClass” is not a member of “FItemStatRow”.

UStructs can’t be UClasses.
Although structs and classes are extremely similar, UStructs and UClasses aren’t.

Though, this wouldn’t work even if it was a class. S_ItemStatRow doesn’t inherit from FItemStatRow, so you would either get a crash or a nullptr. Might as well just use a void*.

What you should do is move all the variables in S_ItemStatRow to FItemStatRow and just get rid of it. Seeing how it has row in the name, I assume this is a data table row. To make the struct data-table compatible, simply make the struct inherit from FTableRowBase and make all variables at least EditDefaultsOnly. Like so:
image

for some reason, the struct definition must be done in the Blueprint Editor

What do you mean by “some reason”?
Data tables do not need their based structure to be blueprint-defined.
You’ll likely also want the properties to be blueprint readwrite.

If you want CPP to have access to a struct, it has to be defined in CPP.