TextBlock bug?

hi,

in my class I add

#include "TextBlock.h" 

UTextBlock* textWidget = NewObject<UTextBlock>(this, UTextBlock::StaticClass());

when I compile I get

Info Compiling game modules for hot reload
Info Performing 2 actions (4 in parallel)
Info WidgetFloaty.cpp
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(15): error C2504: 'UTextLayoutWidget': base class undefined
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(16): error C3646: 'Super': unknown override specifier
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(75): error C3646: 'TextDelegate': unknown override specifier
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(75): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(83): error C3646: 'ColorAndOpacityDelegate': unknown override specifier
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(83): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(99): error C3646: 'ShadowColorAndOpacityDelegate': unknown override specifier
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(99): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(128): error C3668: 'UTextBlock::SynchronizeProperties': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(132): error C3668: 'UTextBlock::ReleaseSlateResources': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(137): error C3668: 'UTextBlock::GetPaletteCategory': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(138): error C3668: 'UTextBlock::OnCreationFromPalette': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(141): error C3668: 'UTextBlock::GetLabelMetadata': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(148): error C3668: 'UTextBlock::RebuildWidget': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(149): error C3668: 'UTextBlock::OnBindingChanged': method with override specifier 'override' did not override any base class methods
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(16): error C2440: 'return': cannot convert from 'UTextBlock *' to 'UObject *'
Info D:\Program Files (x86)\Epic Games\4.12\Engine\Source\Runtime\UMG\Public\Components\TextBlock.h(16): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Info ERROR: UBT ERROR: Failed to produce item: D:\Work\VS\Game\Binaries\Win64\UE4Editor-Game-9224.dll
Info Total build time: 5.27 seconds

if I remove #include “TextBlock.h” and my UTextBlock related code, all back to normal.
due to this, I can’t add text on my widget from C++. Any ideas?

thanks!

oops, false alarm :smiley:

including “TextWidgetTypes.h” right before TextBlock.h like so

#include "TextWidgetTypes.h"
#include "TextBlock.h"

fixed the problem. Thanks!

one more thing, if you want to extend the textblock class, I got the same error that went away when I included these in the new .h class

#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Components/TextWidgetTypes.h"

Thanks, I added a new class extending TextBlock through the in-editor menu, and it didn’t auto include these in the .h for some reason