Anyone managed to expose a UInterface/IInterface from a plugin?

I’m having some issues with UHT crashing when I’m trying to declare a UInterface/IInterface class in my plugin. It crashes with the following:



31>  Building UnrealHeaderTool...
31>  Target is up to date.
31>  Parsing headers for GroundBranchEditor
31>LogWindows : error : Windows GetLastError: The operation completed successfully. (0)
31>Error : Failed to generate code for GroundBranchEditor - error code: CrashOrAssert (3)


Which suggests that parsing headers somehow crashes UHT.

Here’s the code:



// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "TacticalAIInterface.generated.h"


enum TacticalStance
{
	TacAI_Stance_Standing = 0,
	TacAI_Stance_Crouched,
	TacAI_Stance_Prone,
};

UINTERFACE()
class TACTICALAI_API UTestInterface : public UInterface
{
	GENERATED_UINTERFACE_BODY()
};


Anyone spot anything wrong there? I mean if I comment out the UInterface and declare an actor type class it generates and compiles just fine, but UINTERFACE seems to cause issues. So does IINTERFACE afaict.

I can’t think of any way to figure out what’s wrong with it aside from ask here and on answerhub.

Anyone managed to expose a UInterface from within a plugin?

Ta.

And no sooner do I post that question, but i find the answer myself.

I’d misspelt the Interface name for the Interface class. So basically UHT was crashing because it didn’t find a class with GENERATED_UINTERFACE_BODY and a class with GENERATED_IINTERFACE_BODY with the SAME NAME in the same file header.

Here’s mine that works as an example:



UINTERFACE()
class TACTICALAI_API UTacticalAIInterface : public UInterface
{
	GENERATED_UINTERFACE_BODY()
};

class TACTICALAI_API ITacticalAIInterface 
{
	GENERATED_IINTERFACE_BODY()

	//ITacticalAIlInterface();

	UFUNCTION(BlueprintImplementableEvent, Category = "TacAI_IF|Camo")
	virtual float GetCamouflageRating();

	UFUNCTION(BlueprintImplementableEvent, Category = "TacAI_IF|Stance")
	virtual TacticalStance GetCurrentStance();


};


It is complaining about the virtual methods in the ITacticalAIInterface right now, but I’ll figure that out later.