When i use UPROPERTY: UnrealHeaderTool failed

i was following very simple sample at this tutorial:

i have added a new actor class and added only this two lines in the actor header file:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, category = "Pickup", meta = (AllowPrivateAccess = "true"))
class UStaticMeshComponenent* PickupMesh;

but i get this output error:

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: MyProjectCpp14, Configuration: Development_Editor x64 ------
2> Compiling game modules for hot reload
2> Parsing headers for MyProjectCpp14Editor
2> Running UnrealHeaderTool “C:\Users\gokhan.zer\Documents\Unreal Projects\MyProjectCpp14\MyProjectCpp14.uproject” “C:\Users\gokhan.zer\Documents\Unreal Projects\MyProjectCpp14\Intermediate\Build\Win64\MyProjectCpp14Editor\Development\MyProjectCpp14Editor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
2> C:/Users/gokhan.zer/Documents/Unreal Projects/MyProjectCpp14/Source/MyProjectCpp14/MyActor.h(28) : Unrecognized type ‘UStaticMeshComponenent’ - type must be a UCLASS, USTRUCT or UENUM
2>Error : Failed to generate code for MyProjectCpp14Editor - error code: OtherCompilationError (5)
2> UnrealHeaderTool failed for target ‘MyProjectCpp14Editor’ (platform: Win64, module info: C:\Users\gokhan.zer\Documents\Unreal Projects\MyProjectCpp14\Intermediate\Build\Win64\MyProjectCpp14Editor\Development\MyProjectCpp14Editor.uhtmanifest).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ““C:\Epic Games\4.13\Engine\Build\BatchFiles\Build.bat” MyProjectCpp14Editor Win64 Development “C:\Users\gokhan.zer\Documents\Unreal Projects\MyProjectCpp14\MyProjectCpp14.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

when i remove the uproperty line, it compiles succesfull or when i use:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, category = "Pickup", meta = (AllowPrivateAccess = "true"))
int32 i;

i compiles successfull again. but UStaticMeshComponenent does not.

editor: Visual Studio 2015 with Update3 and works as administrative mode.


Try remove “class”:

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, category = "Pickup", meta = (AllowPrivateAccess = "true"))
 UStaticMeshComponenent* PickupMesh;

If UStaticMeshComponent will be unknown, then something is really wrong here. Maybe you need to include StaticMeshComponent.h, but it’s strange.

thanx for reply HungryDoodles,

i had tried only UStaticMeshComponenent PickupMesh;* (without class statament) but got same error again.
and i have tried to include line StaticMeshComponent.h as you said, but unfortunately same error.

i heard that Visual Studio may have any problems with this issue, Update3 or maybe uncorrectly installed component, i dont know…

thanx again…

Hey plimerus,

You have a typo: UStaticMeshComponenent

Change to UStaticMeshComponent

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, category = "Pickup", meta = ( AllowPrivateAccess = "true" ))
UStaticMeshComponent* PickupMesh;

Whenever you get the error, “Unrecognized type”, it is the compilers way of saying that it doesn’t know what type that is. Chances are it is because you have misspelled it.

really ashamed… :smiley:

many many many thanxx…