I am integrating Lyra UI Source Code in my game project and I have some strange errors where compiler tells that he cannot find C++ header file but it is existing in source code.
The error in your screenshot is C1083 on "Settings/LyraSettingsLocal.h". Solution Explorer listing that file does not put it on the compiler’s include path.
Unreal resolves a quoted include like that only from the include paths of the module that is currently compiling (the module root, plus Public/ and Private/). UBT writes those paths into the vcxproj. The VS filter tree is just a view, and it is often stale after you copy files around. A file can show up in the tree and still not be visible to the cpp that actually failed.
In Lyra that header lives in the LyraGame module, at Source/LyraGame/Settings/LyraSettingsLocal.h, not under Public/. Headers outside Public/ are private to that module. Adding "LyraGame" to another module’s Build.cs does not make them includable. So if the cpp that threw C1083 is in your game module (or a UI module you copied) and the header is still inside LyraGame, this is the error you should expect.
Two ways out:
Keep the include in the same module. Move LyraSettingsLocal.h and LyraSettingsLocal.cpp into the module that includes them, at Source/<ThatModule>/Settings/LyraSettingsLocal.h, so the quoted path matches. Then right-click the .uproject and Generate Visual Studio project files. If the file shows as missing/red in the tree, the filter is still pointing at the old location.
Share it across modules. Move only the header to Source/LyraGame/Public/Settings/LyraSettingsLocal.h and add "LyraGame" to PublicDependencyModuleNames of the module that includes it. Private headers stay invisible no matter what Build.cs says.
ULyraSettingsLocal is not a leaf. It pulls in the Lyra local player, the GameSettings UGameUserSettings subclass, and the settings registry. The next missing includes (LyraLocalPlayer.h, LyraSettingsShared.h, and so on) will be the same kind of path problem. Copy the whole Settings folder into one module instead of fixing them one include at a time.
After the move: close the editor and VS, delete that module’s Intermediate and Binaries, regenerate project files, and rebuild. A PCH rebuild alone will not clear C1083.
Hello! I looked into the files you posted, and I believe your build.cs file is still missing the modules.
In Source/OutpostSniperRebels/OutpostSniperRebels.Build.cs you probably need to include the new modules in the PublicDependencyModuleNames list (or possibly the PrivateDependencyModuleNames, depending on where you’re calling the module, but try public first)
Thanks a lot, i was able to compile Lyra UI module in test project! And it works but only if I use LYRAGAME_API in source code, otherwise it does not see classes and cannot inherit from base classes in Unreal Editor UI blueprints.