Blueprint struct fails nativization

If you have a blueprint struct that is referenced in a nativized blueprint class then packaging for Win32 fails with

NewUserDefinedStruct__pf2222656877.h(15): error C2065: 'FStructOnScope': undeclared identifier NewUserDefinedStruct__pf2222656877.h(15): error C2146: syntax error: missing ';' before identifier 'StructOnScope' NewUserDefinedStruct__pf2222656877.h(15): error C3861: 'StructOnScope': identifier not found NewUserDefinedStruct__pf2222656877.h(16): error C2065: 'StructOnScope': undeclared identifier NewUserDefinedStruct__pf2222656877.h(16): error C2228: left of '.GetStructMemory' must have class/struct/union NewUserDefinedStruct__pf2222656877.h(16): note: type is 'unknown-type' NewUserDefinedStruct__pf2222656877.h(16): error C2530: 'DefaultData__': references must be initialized NewUserDefinedStruct__pf2222656877.h(23): error C2653: 'UUserDefinedStruct': is not a class or namespace name NewUserDefinedStruct__pf2222656877.h(23): error C3861: 'GetUserDefinedStructTypeHash': identifier not found

Repro steps for this:

  1. Create a new project (I chose the 3rd person template for this)
  2. In the Blueprints folder create a new Structure UAsset
  3. In the ThirdPersonCharacter BP add a variable that is the type created in step 2
  4. Go to packaging settings and change “Blueprint Nativization Method” to “Inclusive”
  5. Package for “Windows (32-bit)”

Hello kgamble,

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates

Link: Unreal Engine Issues and Bug Tracker (UE-44421)

Make it a great day