[STRUCTS] How to fix warning "The identifier 'GENERATED_USTRUCT_BODY' was detected in a block being skipped. Was this intentional?"

Hi there,
I am trying to create a struct consisting of a few parameters. However, when compiling the solution, the mentioned warning occurs. Here is a snippet of the code. Any help is appreciated:

USTRUCT(BlueprintType)
struct FFoliageEffectData
{
GENERATED_USTRUCT_BODY()
public:

UPROPERTY(EditAnywhere)
uint8 bDisabled : 1;

// True to check foliage/ecosystem system for this mesh.  False to save frametime. 
UPROPERTY(EditAnywhere)
uint8 bCheckFoliage : 1;

// True to check grass system for this mesh.  False to save frametime. 
UPROPERTY(EditAnywhere)
uint8 bCheckGrass : 1;

UPROPERTY(EditAnywhere)
UStaticMesh* FoliageMesh = nullptr;

Does this work? I changed the type of the variables from uint8 to bool.

USTRUCT(BlueprintType)
struct FFoliageEffectData
{
GENERATED_USTRUCT_BODY()
public:

UPROPERTY(EditAnywhere)
bool bDisabled;

// True to check foliage/ecosystem system for this mesh.  False to save frametime. 
UPROPERTY(EditAnywhere)
bool bCheckFoliage;

// True to check grass system for this mesh.  False to save frametime. 
UPROPERTY(EditAnywhere)
bool bCheckGrass;

UPROPERTY(EditAnywhere)
UStaticMesh* FoliageMesh = nullptr;

Not sure if this will fix it but I’m using:

GENERATED_BODY()

Instead of:

GENERATED_USTRUCT_BODY()
1 Like

Could be a solution as well… I have noticed that the UE4 version may be different from UE5.

Hi there,

Thank you both for the support, unfortunately there might be something else wrong, and I haven’t found any reference to this type of warning. Is there any way to force compiling even when warning occurs? It is not an error in the code.

I’ve started this project back in UE4, now with UE5.1, this warning may be occurring due to the recent updates in the API. I’ll keep searching, but at the moment, I have no idea what to do next.

Thank you again for the support.

Is your stuff wrapped in a #if block?
Those are not properly supported by UHT.

The only thing that stop compilation is errors, it should compile with warnings.
Could you post the whole file? And post your errors and warning log?

Hi, I’ve verified and there’s no #if blocks. I’ll keep searching through the documentation.
Thank you.

Hi, unfortunately, I can’t post the whole code. That is the only warning occurring and this is the description:
Severity Code Description File Line Column Suppression State
Error MSB3073 The command ““C:\Program Files\Epic Games\UE_5.1\Engine\Build\BatchFiles\Build.bat” Ambience510.Editor Win64 DebugGame -Project=“C:\Users\Public\Documents\StudyGuide\Ambience510\Ambience510.uproject” -WaitMutex -FromMsBuild” exited with code 6. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44 5

Thank you for the help.

I’m a little late to the party, but hopefully it’s helpful to future troubleshooting!

I have received this error when I’ve made a typo further up in the file, such as forgetting a semi-colon in my forward declarations or after another class declaration.

I don’t think I have ever seen it for any other reason. Although I briefly thought I found an exception today, which is how I ended up on this thread :laughing: but then after going back and checking more methodically, I really did just forget a semi-colon again.

5 Likes

fwiw I just ran into this when trying to define a USTRUCT within a namespace. So that seems to be another possibility.

2 Likes

I had this error and banged my head till i replaced the definition with another one that was working then typed the correct name. Seams there was an non displayable character there. check hexa of ur struct and see if u can spot it. Or rewrite it from scratch then replace the whole code area.

Thanks, that did it for me. This post highlights some of the reasoning why UHT does not support namespaces.