LNK2019/1120 error when using FMoveCursor::Cardinal or ViaScreenPointer static function

Hello there,

I’m currently trying to implement a custom EditableText, and at one point I want to auto select the next character. After digging in the source code, I found the function MoveCursor of FSlateEditableTextLayout (FSlateEditableTextLayout::MoveCursor | Unreal Engine 5.2 Documentation), which take a FMoveCursor as parameter (FMoveCursor | Unreal Engine 5.2 Documentation).

This class has 2 static functions which act as constructors : Cardinal and ViaScreenPointer. FMoveCursor::Cardinal seems to be what I want, so I wrote the following line, inside my custom SEditableText class (which inherit from SEditableText) :

EditableTextLayout->MoveCursor(FMoveCursor::Cardinal(ECursorMoveGranularity::Character, FIntPoint(0, 1), ECursorAction::SelectText));

Problem here, I get a link error :

 LNK2019: unresolved external symbol "public: static class FMoveCursor __cdecl FMoveCursor::Cardinal(enum ECursorMoveGranularity,struct UE::Math::TIntPoint<int>,enum ECursorAction)" (?Cardinal@FMoveCursor@@SA?AV1@W4ECursorMoveGranularity@@U?$TIntPoint@H@Math@UE@@W4ECursorAction@@@Z) referenced in function "public: virtual void __cdecl SEditableTextCustomSuppr::OnTextChanged(class FText const &)" (?OnTextChanged@SEditableTextCustomSuppr@@UEAAXAEBVFText@@@Z))

First reaction : check the module and dependencies in Build.cs, and everything seems to be fine. FMoveCursor is in Slate module, and it’s written in my Build.cs :

PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

This post (Unresolved External Symbols) is mentionning the possible missing extern, which indeed I’m not seeing here in the source code :
image

But is it really this problem ? If so, do I have another solution than editing the Engine code by adding SLATE_API before the class name ?

Thanks :slight_smile: