Can't add UInstancedStaticMeshComponent

Hello!

I’m quite new to C++ programming in UE4. I am trying to add UInstancedStaticMeshComponent to actor, but I’m getting error when I add those 2 lines in class header in public section:

UPROPERTY()
UInstancedStaticMeshComponent * ISMC_Blocks;

The error on compilation I’m getting is:

Error C:\Dev\UE\Voxel\Source\Voxel\Public\Chunk.h(30) : error C2143: syntax error: missing ';' before '*'
Error C:\Dev\UE\Voxel\Source\Voxel\Public\Chunk.h(30) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error C:\Dev\UE\Voxel\Source\Voxel\Public\Chunk.h(30) : error C2238: unexpected token(s) preceding ';'
Error C:\Dev\UE\Voxel\Source\Voxel\Public/Chunk.h(30) : error C2143: syntax error: missing ';' before '*'
Error C:\Dev\UE\Voxel\Source\Voxel\Public/Chunk.h(30) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error C:\Dev\UE\Voxel\Source\Voxel\Public/Chunk.h(30) : error C2238: unexpected token(s) preceding ';'
Error C:\Dev\UE\Voxel\Intermediate\Build\Win64\UE4Editor\Inc\Voxel\Voxel.generated.cpp(523) : error C2039: 'ISMC_Blocks': is not a member of 'AChunk'
Error C:\Dev\UE\Voxel\Source\Voxel\Public/Chunk.h(9) : note: see declaration of 'AChunk'
Error C:\Dev\UE\Voxel\Intermediate\Build\Win64\UE4Editor\Inc\Voxel\Voxel.generated.cpp(523) : error C2664: 'UObjectProperty::UObjectProperty(const UObjectProperty &)': cannot convert argument 1 from 'FObjectInitializer' to 'ECppProperty'
Error C:\Dev\UE\Voxel\Intermediate\Build\Win64\UE4Editor\Inc\Voxel\Voxel.generated.cpp(523) : note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Other components lile UStaticMesh work just fine. What am I doing wrong? Or as I suppose what am I not doing?

Ok. Somehow I found solution. All you need is to add include at start of you file:

#include "Components/HierarchicalInstancedStaticMeshComponent.h"

Like this:

#pragma once
#include "GameFramework/Actor.h"
#include "Components/HierarchicalInstancedStaticMeshComponent.h"
#include <Block.h>
#include <HelperTypes.h>
#include "Chunk.generated.h"