Developer Notes

This is because ENetMote is not a a UCLASS, USTRUCT or UENUM. UHT can't see or parse types that are native only.

Description

Marking a function as BlueprintPure will result in a UHT build failure in Visual Studio if the function returns an ENetMode value. The ENetMode enum is not marked as a UENUM(), causing the build to fail.

Steps to Reproduce
  1. Create a new code project using the First Person template.
  2. Build the project in Visual Studio.
  3. In the header file for the character class created with the template, add the following lines at the bottom of the class:
    UFUNCTION(BlueprintPure, Category = "Replication")
    ENetMode  GetTheNetMode() const;
    
  4. In the source file for the character class, add the following function:
    ENetMode ATestUHTCrash1Character::GetTheNetMode() const
    {
    	return NM_Standalone;
    }
    
  5. Build the project in Visual Studio.

RESULT:
The build will fail with the message Unrecognized type 'ENetMode'

  • In 4.10, the message has been expanded to also say type must be a UCLASS, USTRUCT or UENUM

EXPECTED:
The build finishes successfully.

Have Comments or More Details?

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

0
Login to Vote

By Design
ComponentUE - Foundation - Core
Affects Versions4.8.24.10
Target Fix4.10
CreatedAug 5, 2015
ResolvedAug 7, 2015
UpdatedFeb 5, 2017