Issue on compiling a slate widget

It seems 4.10.4 doesn’t compile slate widgets.
To be sure, I have created a new C++ project from First Person template and it compiles and works fine.

Then I have modified my *.Build.cs as follow:

using UnrealBuildTool;

public class SlateTest : ModuleRules
{
	public SlateTest(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
        PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    }
}

And it still compiles and works fine.

Finally I have created a new C++ Slate Widget from Unreal Editor, I have not touched the code and compiler result is:

1>------ Inizio compilazione: Progetto: UE4, Configurazione: BuiltWithUnrealBuildTool Win32 ------
2>------ Inizio compilazione: Progetto: SlateTest, Configurazione: Development_Game x64 ------
2>  Creating makefile for SlateTest (.uproject file is newer)
2>  Parsing headers for SlateTest
2>    Running UnrealHeaderTool "D:\dino\Unreal Projects\SlateTest\SlateTest.uproject" "D:\dino\Unreal Projects\SlateTest\Intermediate\Build\Win64\SlateTest\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
2>  Reflection code generated for SlateTest in 8,9137312 seconds
2>  Performing 2 actions (4 in parallel)
2>  SMyCompoundWidget.cpp
2>d:\program files\epic games\4.10\engine\source\runtime\slatecore\public\widgets\SWidget.h(87): error C2143: errore di sintassi: ';' mancante prima di '*'
2>d:\program files\epic games\4.10\engine\source\runtime\slatecore\public\widgets\SWidget.h(87): error C2433: 'ILayoutCache::FCachedWidgetNode': 'virtual' non consentito su dichiarazioni di dati
2>d:\program files\epic games\4.10\engine\source\runtime\slatecore\public\widgets\SWidget.h(87): error C4430: identificatore di tipo mancante, verrà utilizzato int. Nota: default-int non è più supportato in C++
2>d:\program files\epic games\4.10\engine\source\runtime\slatecore\public\widgets\SWidget.h(87): error C2238: token imprevisti prima di ';'
2>  -------- End Detailed Actions Stats -----------------------------------------------------------
2>ERROR : UBT error : Failed to produce item: D:\dino\Unreal Projects\SlateTest\Binaries\Win64\SlateTest.pdb
2>  Total build time: 16,05 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: uscita dal comando ""D:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" SlateTest Win64 Development "D:\dino\Unreal Projects\SlateTest\SlateTest.uproject" -rocket -waitmutex -2015" con codice -1.
========== Compilazione: 1 completate, 1 non riuscite, 0 aggiornate, 0 ignorate ==========

I think it is a bug as I have done similar activities several times before installing 4.10.4.

Hello Dino,

Go into your “ProjectName”.h file and add

#include “SlateBasics.h”

This should fix the compiler error that you are seeing.

Have a great day

Are the Slate tutorials / Docs going to be updated soon for this kind of stuff? A lot is out of date and just flat out wrong. Leads to a lot of wasted dev time.

Currently we have the official docs, which I’m sure you’ve looked over:

As of right now, I’m not aware of any plans in the near future to update the Slate documentation. I would, however, recommend working with UMG instead if you’re looking to create UI, as it’s a much more user-friendly system.