Unrecognized type on UFUNCTION declaration with a struct parameter

I have a class with a function that receives a struct as parameter:

struct FMyStruct;

UCLASS()
class MYPROJECT_API UMyObject: public UObject
{
	GENERATED_BODY()

//...

protected:

    void MyFunction(const FMyStruct& MyStruct);

//...

};

The problem is that I want that function to be a UFUNCTION to be called in Blueprints but making that change gives me this error:

Unrecognized type ‘FMyStruct’ - type must be a UCLASS, USTRUCT or UENUM

My struct is declared in other file and it is an USTRUCT so I don’t know where does this error come from:

USTRUCT()
struct FMYStruct
{
	GENERATED_BODY()

public:

    UPROPERTY()
    float Var;

//...
};

Any ideas?

As I understand it:
Without UFUNCTION(), .h file only declares the function and does nothing else, so you can put anything you want in the parameters, and it will compile. But UFUNCTION() calls for some other under-the-hood procedures, but your struct is inaccessible, because the engine doesn’t know where to find it.

I guess you have to #include the file where the struct is declared to your object’s .h file, and it will work.