LINK : fatal error LNK1104

Hi, I’ve encountered an error that I can’t understand.
I created a new project in UE5 (I tried with both 5.0.3 and 5.1.1). I create a new C++ class and click build to compile everything. But every time it gives me errors.

If I build from VS:

Error MSB3073 exiting command ““D:\Games\Epic Games\Games\UE_5.1\Engine\Build\BatchFiles\Build.bat” projectWarEditor Win64 Development -Project=“C:\Users\User\Documents\CODES\Unreal Engine\project-war\projectWar.uproject” -WaitMutex -FromMsBuild” with code 6.

AND

Error (active) E0070 incomplete type not allowed projectWar D:\Games\Epic Games\Games\UE_5.1\Engine\Source\Runtime\SlateCore\Public\Layout\BasicLayoutWidgetSlot.h

While if I save the files and leave the compilation to LIVE CODING it gives me this error:

LINK : fatal error LNK1104: unable to open file ‘C:\Users\2care\Documents\CODES\Unreal Engine\project-war\projectWar\Binaries\Win64\UnrealEditor-projectWar.patch_0.exe’
Failed to link patch (0.000s) (Exit code: 0x450)

I just created a class without even messing around with the code. Can anyone tell me why all these errors?

You have to include "SlateCore" in your build dependencies.

1 Like

Ohh, how can I include this?
But why UE5 do not include SlateCore in automatic?

TLDR: Unreal is made up of modules, and you have to include these modules manually in your project’s .Build.cs file.


I tried, but there are still the same errors :frowning:

Did you create the new C++ class through the Unreal editor or just in C++?