Replacing GENERATED_UINTERFACE_BODY() with GENERATED_BODY() in 4.7.0 or above results in an Unreal Header Tool crash and build failure in Visual Studio.

This was working in 4.6.1, but when tested in 4.7.0, 4.7.1, and 4.8 (Main), the build failed each time.

Steps to Reproduce
  1. Create a new code project using the First Person template, no starter content.
  2. Add a new Actor class to the project. Name the class ToStringInterface
  3. Close the Editor.
  4. Replace the contents of the new header file with the following code:
    #pragma once
    #include "ToStringInterface.generated.h"
    class UToStringInterface : public UInterface
    class IToStringInterface
    	virtual FString ToString();
  5. Replace the contents of the source code file with the following code:
    UToStringInterface::UToStringInterface(const class FPostConstructInitializeProperties& PCIP)
    	: Super(PCIP)
    FString IToStringInterface::ToString()
    	return "IToStringInterface::ToString()";
  6. Build the project.
    • Note the project builds successfully.
  7. In the header file, replace GENERATED_UINTERFACE_BODY() with GENERATED_BODY().
  8. In the source code file, remove the constructor.
  9. Build the project in Visual Studio.

The Unreal Header Generation Tool crashes and Visual Studio displays the following output:

1>Error : Failed to generate code for TestInterface2Editor - error code: -1073741819 (-1073741819)
1>  UnrealHeaderTool failed for target 'TestInterface2Editor' (platform: Win64, module info: C:\Users\Tim.Lincoln\Documents\Unreal Projects\TestInterface2\Intermediate\Build\Win64\TestInterface2Editor\Development\UnrealHeaderTool.manifest).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "D:\Source\UnrealEngine-4.7.0-release\Engine\Build\BatchFiles\Build.bat TestInterface2Editor Win64 Development "C:\Users\Tim.Lincoln\Documents\Unreal Projects\TestInterface2\TestInterface2.uproject"" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

The build completes successfully.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

Login to Vote

ComponentUE - Foundation - Core
Affects Versions4.
Target Fix4.8
Fix Commit2481360
CreatedMar 3, 2015
ResolvedMar 26, 2015
UpdatedSep 23, 2019