TArray<FOnlineSessionSearchResult> Unable to find 'class', 'delegate', 'enum', or 'struct' with name 'FOnlineSessionSearchResult' [UnrealHeaderTool Error]

I have this function

UFUNCTION(BlueprintCallable, Category = "Network|Test")
void Finder(APlayerController *PlayerController, int MaxResults, bool UseLan, TArray<FOnlineSessionSearchResult> &fOnlineSessionSearchResult);

The problem originates when I put:
TArray < FOnlineSessionSearchResult> &fOnlineSessionSearchResult
I get compile time error: “Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FOnlineSessionSearchResult’ [UnrealHeaderTool Error]”

How can I solve this?

1 Like

You fix it by not trying to use the FOnlineSessionSearchResult in Blueprint. That structure is not a USTRUCT so it’s not exposed to reflection so it can’t be used in Blueprint.

You could write your own version that’s blueprint accessible and convert between them, but it’s probably easier to just stay in C++.

2 Likes

I have already realized that there are two versions. One for the C++ and the other for the Blueprint.

1 Like