Can delegate definitions be defined in their own separate header file?

I’d like to have a C++ header file that just contains delegate definitions. Something like this?

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(F_Message, FString, Message);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(F_Error, FString, ErrorMessage);

When I try to do this and compile, I get tons of compile errors. The only why I’ve worked around this in the past was to create a dummy C++ class inherited from UObject, where the class is completely empty. Does this have something to do with needing a .generated.h file as well?