Link error on FSlateApplication::Get().GetPlatformApplication() ?

I see this code in other forum threads:

TSharedPtr<GenericApplication> app = FSlateApplication::Get().GetPlatformApplication();

But when I try and do this (on windows) I get a link error?

2>WindowActivation.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: static class TSharedPtr<class GenericApplication,1> FSlateApplicationBase::PlatformApplication" (__imp_?PlatformApplication@FSlateApplicationBase@@1V?$TSharedPtr@VGenericApplication@@$00@@A) referenced in function "public: class TSharedPtr<class GenericApplication,1> __cdecl FSlateApplicationBase::GetPlatformApplication(void)" (?GetPlatformApplication@FSlateApplicationBase@@QEAA?AV?$TSharedPtr@VGenericApplication@@$00@@XZ)

is there some dependency that I have to add besides these?

PublicDependencyModuleNames.AddRange(new string[] {
    "Core", 
    "CoreUObject", 
    "Engine", 
    "InputCore",
    "InputDevice",
    "EnhancedInput",
    "ApplicationCore",
    "Slate",
});

Isn’t this forum amazing. Hardly anyone ever replies to the harder questions. I also have exactly this same problem and no idea how to solve it.

I also have a string of questions like this with no answers.

This link says:

Whenever you get linker errors like these, try looking up the structure that is being mentioned (in this case “FSlateFontInfo”) in the UE4 API. If you navigate to the bottom of the page, you will see the module that you need to add to your .build.cs file.

See also this link.