Please help me to resolve this issue! I do not understand why compiler not compiling source code. Almost all plugins where added in unreal project file.
That error is an engine mismatch, not a missing include. UGameUserSettings::GetDisplayID() and SetDisplayID() were added in UE 5.5 so Game User Settings can remember which monitor the window is on. Lyra’s settings code (ULyraSettingsLocal, and the Common Game user settings under it) calls that method. If the Lyra UI sources you copied are from a newer sample than the engine this Third Person project is actually compiling against, the compiler is reading your engine’s GameUserSettings.h, which has no such member. The other errors are the same class of problem: Lyra APIs that this engine’s headers do not have.
A few things that actually fix it:
Open Engine/Source/Runtime/Engine/Classes/GameFramework/GameUserSettings.h for the engine this project is set to, and search for GetDisplayID. If it is not in that file, no plugin checkbox will create it. Check the .uproject engine association so you are not looking at a different installed engine than the one you build with.
Use the Lyra sample that shipped with that same engine version, not Lyra from a newer launcher install and not ue5-main. Copying only the UI .cpp/.h files also skips the modules those files live in (CommonUI, CommonGame, GameSettings, Lyra’s own GameSettings module). Those plugins do need to be enabled, and the module has to be in your Build.cs, but that still will not compile if the engine itself is older than the code.
If you have to stay on the older engine, remove the GetDisplayID / SetDisplayID calls instead of pretending the setting exists. Older UGameUserSettings has no saved monitor index. Primary monitor is the compatible behavior:
int32 PreferredMonitor = 0;
FDisplayMetrics Metrics;
FDisplayMetrics::RebuildDisplayMetrics(Metrics);
for (int32 Index = 0; Index < Metrics.MonitorInfo.Num(); ++Index)
{
if (Metrics.MonitorInfo[Index].bIsPrimary)
{
PreferredMonitor = Index;
break;
}
}
FDisplayMetrics is in GenericPlatform/GenericApplication.h (ApplicationCore). After editing, delete the project’s Binaries and Intermediate and rebuild so you are not staring at a stale error list. Expect more of these until the Lyra files match the engine version.