Description

Note: This happens with "Exclusive" nativization mode as well.

This occurs because the nativized UDS 'GetDefaultValue()' method is generated into a .h file rather than a .cpp file. This creates a circular dependency between header files.

Current workaround: None.

Proposed fix: Generate the 'GetDefaultValue()' implementation into a .cpp file instead.

Steps to Reproduce
  1. Launch UE4 editor with a new, blank C++ project.
  2. Create a new Actor-based Blueprint class (MyBlueprint) and save.
  3. Create a new User-Defined Structure (MyStructure) and open it for editing.
  4. Change the type on "Member_0" to a MyBlueprint class reference.
  5. Change the default value to 'MyBlueprint'.
  6. Save and close the UDS editor window.
  7. Open the 'MyBlueprint' asset for editing.
  8. Add a new variable and change the type to 'MyStructure'.
  9. Compile, save and close the editor window.
  10. Drag an instance of MyBlueprint into the current level.
  11. Save the current level (NewMap).
  12. Go to "Edit->Project Settings..." and Project/Maps & Modes, and under "Default Maps" change both to "NewMap."
  13. Switch to Project/Packaging and change "Blueprint Nativization Method" to "Inclusive."
  14. Close the Project Settings window, and go to "File->Package Project->Windows->Windows (64-bit)"
  15. Choose/create a folder for packaging and accept.
  16. Compile errors should occur during packaging:
UATHelper: Packaging (Windows (64-bit)): xgConsole: NativizedAssets.generated.cpp
UATHelper: Packaging (Windows (64-bit)): xgConsole: d:\dev\epic\ue4\dev-framework\ue_44123_2\intermediate\plugins\windowsnoeditor\nativizedassets\source\nativizedassets\public\MyBlueprint__pf1010915279.h(15): error C3646: 'bpv__MyStructVar__pf': unknown override specifier
UATHelper: Packaging (Windows (64-bit)): xgConsole: d:\dev\epic\ue4\dev-framework\ue_44123_2\intermediate\plugins\windowsnoeditor\nativizedassets\source\nativizedassets\public\MyBlueprint__pf1010915279.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\dev\Epic\UE4\Dev-Framework\UE_44123_2\Intermediate\Plugins\WindowsNoEditor\NativizedAssets\Intermediate\Build\Win64\UE_44123_2\Inc\NativizedAssets\NativizedAssets.generated.cpp(129): error C2039: 'bpv__MyStructVar__pf': is not a member of 'AMyBlueprint_C__pf1010915279'
UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\dev\Epic\UE4\Dev-Framework\UE_44123_2\Intermediate\Plugins\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Public/MyStructure__pf1010915279.h(5): note: see declaration of 'AMyBlueprint_C__pf1010915279'
UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\dev\Epic\UE4\Dev-Framework\UE_44123_2\Intermediate\Plugins\WindowsNoEditor\NativizedAssets\Intermediate\Build\Win64\UE_44123_2\Inc\NativizedAssets\NativizedAssets.generated.cpp(129): error C2664: 'UStructProperty::UStructProperty(const UStructProperty &)': cannot convert argument 1 from 'FObjectInitializ
er' to 'ECppProperty'
UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\dev\Epic\UE4\Dev-Framework\UE_44123_2\Intermediate\Plugins\WindowsNoEditor\NativizedAssets\Intermediate\Build\Win64\UE_44123_2\Inc\NativizedAssets\NativizedAssets.generated.cpp(129): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
UATHelper: Packaging (Windows (64-bit)): xgConsole: 
UATHelper: Packaging (Windows (64-bit)): xgConsole: Error executing D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe (tool returned code: 2)
UATHelper: Packaging (Windows (64-bit)): xgConsole: NativizedAssets_Dependencies.cpp
UATHelper: Packaging (Windows (64-bit)): xgConsole: NativizedAssets.cpp
UATHelper: Packaging (Windows (64-bit)): xgConsole: MyBlueprint__pf1010915279.cpp
UATHelper: Packaging (Windows (64-bit)): xgConsole: d:\dev\epic\ue4\dev-framework\ue_44123_2\intermediate\plugins\windowsnoeditor\nativizedassets\source\nativizedassets\public\MyStructure__pf1010915279.h(20): error C2027: use of undefined type 'AMyBlueprint_C__pf1010915279'
UATHelper: Packaging (Windows (64-bit)): xgConsole: d:\dev\epic\ue4\dev-framework\ue_44123_2\intermediate\plugins\windowsnoeditor\nativizedassets\source\nativizedassets\public\MyStructure__pf1010915279.h(5): note: see declaration of 'AMyBlueprint_C__pf1010915279'
UATHelper: Packaging (Windows (64-bit)): xgConsole: d:\dev\epic\ue4\dev-framework\ue_44123_2\intermediate\plugins\windowsnoeditor\nativizedassets\source\nativizedassets\public\MyStructure__pf1010915279.h(20): error C3861: 'StaticClass': identifier not found
UATHelper: Packaging (Windows (64-bit)): xgConsole: 
UATHelper: Packaging (Windows (64-bit)): xgConsole: Error executing D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe (tool returned code: 2)

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-44222 in the post.

4
Login to Vote

Fixed
Fix Commit3424325
Main Commit3431398
CreatedApr 20, 2017
ResolvedMay 4, 2017
UpdatedOct 3, 2019