Unfortunately we simply don't have the time and resources to make UHT work like a true compiler. UHT can currently parse the most common C++ syntax cases and that works for 95% of cases.
A project building in Visual Studio will sometimes fail with the error Unrecognized type 'FBar' - type must be a UCLASS, USTRUCT or UENUM. This can occur in situations where one struct was referenced by a second struct and both structs were changed so that the first struct now references the second, but only if the include pre-processor instruction includes a space (ie. "# include").
The user who reported the issue suspects that there is a problem with how FHeaderParser::SimplifiedClassParse handles the include instruction. The whitespace after the # seems to be throwing it off.
USTRUCT()
struct FFoo {
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Foo")
bool bRepro;
};
USTRUCT()
struct FBar {
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Bar")
TArray<FFoo> Foos;
};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Bar")
bool bRepro;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Foo")
TArray<FBar> Bars;
RESULT:
The build fails with the error: Unrecognized type 'FBar' - type must be a UCLASS, USTRUCT or UENUM
EXPECTED:
The build succeeds since a space in the include pre-processor instruction should not affect the instruction.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.12.5, 4.13, 4.14 |
Target Fix | 4.14 |
Created | Sep 23, 2016 |
---|---|
Resolved | Sep 29, 2016 |
Updated | Apr 27, 2018 |