How to use UUserWidget?

Hello.

I am trying to use some code, like this:

#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
......................
UUserWidget* WidgetObj;

but it’s returns error:

CompilerResultsLog:Error: Error E:\UnrealEngine\Engine\Source\Runtime/UMG/Public/Blueprint/UserWidget.h(5) : fatal error C1083: Cannot open include file: 'Components/SlateWrapperTypes.h': No such file or directory

What I am doing wrong?

Or it’s bug in the UE 4.12 branch?

Thank you!

Hi,
take a look at this :
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums.

You need to include Slate, SlateCore and UMG in your project.build.cs file.

Thank you!