So I’m trying to define a USTRUCT inside its own header file (LeapFrameData.h) and then reference that type inside the header for a seperate UCLASS (LeapInputComponent) inside a plugin module.
Regardless of where I place LeapFrameData.h, inside Private/ or Classes/, I have to manually #include that header in LeapInputComponent.h, even though LeapBlueprintSupportPrivatePCH.h already includes it and is present in LeapInputComponent.h (It’s commented out in the below sample code). If that line is commented or missing then I get the following error from UBT:
Classes/LeapInputComponent.h(10): error : In LeapInputComponent: Unrecognized type 'FLeapFrameData'
LeapFrameData.generated.h is not generated in this scenario, either.
My understanding was we should put module-wide header files inside the *PrivatePCH file for the module (certainly the comments in the sample plugin indicate as much). If that’s the case, I surely shouldn’t also be having to manually #include it into a header that needs it, I should just be able to use PrivatePCH instead?
LeapFrameData.h
#pragma once
#include "LeapFrameData.generated.h"
USTRUCT()
struct FLeapFrameData
{
public :
GENERATED_USTRUCT_BODY()
};
LeapBlueprintSupportPrivatePCH.h
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "CoreUObject.h"
#include "Engine.h"
#include "Core.h"
#include "ILeapBlueprintSupport.h"
#include "LeapFunctionLibrary.h"
#include "LeapInputComponent.h"
#include "LeapFrameData.h"
#include "Leap.h"
LeapInputComponent.h
#pragma once
#include "LeapBlueprintSupportPrivatePCH.h"
//#include "LeapFrameData.h"
#include "LeapInputComponent.generated.h"
<Class definition follows, snipped>