I have an issue with creating new plugin for Lyra. To be more specific with Game Feature with c++.
After I hit, Game Feature (with c++) I get this message:
Failed to compile plugin source code. See output log for more information.
If I want to make Game Feature (Content Only) it works.
Is it possible you’re somehow running the compile while UE5.1 is running the project, and not compiling via the Live Code feature? Because the filenames there don’t look like the Live Code patch filenames to me… and if the project is already running, then yeah, the file will not be able to be opened for write, because it’ll be in active use by the engine.
(Forgive me if this is something you’ve already considered/checked; it never hurts to confirm the basics before looking for more complicated causes!)
Dear All,
sorry for double posting, I want to share that I solved my problem by downloading Visual Studio 2022, creating the project file for it, and then compiling the project from there with UE 5.1 closed.
You can find below how to create the VS project file for your UE project:
If you right click the LyraStarterGame.uproject file you can associate it with a different installed version of the engine if you have multiple copies installed, or generate project files for compiling with a source code editor.
I’m glad you found your solution! Yeah, anything that requires recompiling from C++ will require a toolset; on Windows you need Visual Studio of some vintage (I believe 2017 or later), on macOS you need Xcode, on Linux you need the general compiler toolchain… even if you use another development environment (like JetBrains Rider), the engine’s toolchain still expects the appropriate compiler environment to be present.
To clarify on what “Live Code” is… you mention that you built the project while Unreal wasn’t running, which is a definitely the best way to do a full clean build of things!
However, while you cannot replace files that are loaded into memory (and thus cannot compile new copies of the main game while it’s running), Unreal has a mode called Live Code where it can compile ‘patches’ to the game, which will then be loaded in to the running copy; these will get loaded in on top of the existing code to add updated versions of code in the game. This is very useful for tweaking and debugging code in the running engine, without having to quit the game, recompile everything, restart, etc.
My original question was because I’ve seen a lot of people not aware of the Live Code mode try to compile the game the normal way while it’s running. Usually the engine is very good about warning you about this and telling you to use the LIve Code feature, but I have seen occasional instances where the compile just… fails, without that message.
I have encountered the same error in a blank C++ project. Adding the “Content Only” GameFeature works perfectly fine, but when I try to add a GameFeature (with C++), I can see it appear in the Plugins\GameFeatures folder for a moment, and then the UE5 editor shows me “Failed to compile plugin source code. See output log for more information.” error and removes my plugin folder.
I managed to make a copy of the folder while it was still there and then restored it after closing the error popup. After restarting the editor, I was able to compile and enable the plugin in the “Plugins” section.
It has no .uasset for GameFeature
PS: I have LiveCoding OFF atm, but error was the same with LiveCoding ON too