Live coding error

Hi, i am coding in ue but when i try to compile it gives me an unspecified error, it just says "Patch could not be activated at the end of compilation without errors or warnings.
I cannot figure out why, but i think it has something to do with the compiler c# files, so i’ll write them here
Note that this project is still pretty small, i just started it.

attritionEditor.Target.cs

using UnrealBuildTool;
using System.Collections.Generic;

public class attritionEditorTarget : TargetRules
{
	public attritionEditorTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		IncludeOrderVersion = EngineIncludeOrderVersion.Latest;

		ExtraModuleNames.AddRange(new string[] { "attrition" });
	}
}

attrition.Target.cs

using UnrealBuildTool;
using System.Collections.Generic;

public class attritionTarget : TargetRules
{
	public attritionTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		IncludeOrderVersion = EngineIncludeOrderVersion.Latest;

		ExtraModuleNames.AddRange(new string[] { "attrition" });
	}
}

attrition.Build.cs

using UnrealBuildTool;

public class attrition : ModuleRules
{
	public attrition(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicIncludePaths.AddRange(
			new string[] {
				"attrition"
			}
		);

		PrivateIncludePaths.AddRange(
			new string[] {
			}
		);

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "ModularGameplay" });

		DynamicallyLoadedModuleNames.AddRange(
			new string[] {
			}
		);

		// Generate compile errors if using DrawDebug functions in test/shipping builds.
		PublicDefinitions.Add("SHIPPING_DRAW_DEBUG_ERROR=1");
	}
}

Thanks in advance

Hi Pelaculi,

Try compiling from Visual Studio with your project closed first to see if you still get any errors.

If you do, they should be in the VS compiler log…

It works w/o unreal??

There is a “.sln” file in the same folder as your project - that’s the Visual Studio project file which you can double click to open in Visual Studio (without your project open in UE).

image

You can build that without unreal running, and when you execute it - the Unreal Editor will start up with your project loaded.

when i try to start up after the compilation is says

The game module ‘attrition’ could not be loaded. There may be an operating system error, the module may not be properly set up, or a plugin which hash been included into the build has not been turned on

What do i do now?

There’s a good post here about that (isgoed’s answer):

1 Like

i did all the passages there, but there was no error when i switched to development editor and when i open the debug output it shows nothing

You mention your project is still small - perhaps it would be easiest to start a new project and slowly add your code over to the new project?

not sure if it will be useful for @Pelaculi still, but i will still post it; this error can be caused too by using a plugin in the code BUT NOT enabling it in the editor (i.e. the data in the uproject file, if it’s not convenient to open unreal editor up, you can open that file in visual studio); as the same error after VS build states, “or a plugin which has been included into the build has not been turned on”

the error @Pelaculi shown at the beggining explains that everything built without mistakes, but the patch couldn’t be linked because some metadata was lacking, obviously this is not verbose, but the metadata is just that, the inclusion of the plugin in the project “header”, i.e. the .uproject file.