GetDisplayID is not member of UGameUserSettings

Hi,

I am integrating Lyra UI module in my 3rd person test project, I am getting much of errors.

I have copied files of Lyra to my test project, only UI source files.

I have strange errors, “GetDisplayID is not member of UGameUserSettings” and so on…

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.

Ruslan.

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:

  1. 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.
  2. 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.
  3. 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.

Thanks a lot, ChenDong!! Really, project was created in 5.7 but Lyra version is new for 5.8..

I will compile and tell you result.

But I have in another my game big project new compiler errors after updating 5.8.3!

Can you please help me, some strange new compiler error and I do not understand why it is appears after updating to newest unreal engine version..

Please help me.