UWidgetBlueprintLibrary linking error

Almost one year later but I’m starting with C++ in UE4 and got this error today.
Looking arround the web, I found a forum post about FReply and the solution was to add SlateCore to the public dependency on Build.cs

You need to add “SlateCore” to PublicDependencyModuleNames in Build.cs of your project.

But in this case, the module isn’t SlateCore but UMG

Here is my example of Project.Build.cs

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });

Forum post: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1703185-freply-unresolved