UE5.1 C++ Editor Module failing to initialize after loading

Trying out 5.1 (and by extension 5.X) for the first time and following along with a tutorial that was written for 5.0 however I’m running into an issue with the creation of a custom editor module. As far as I can tell, the module builds successfully, and gets loaded but I get an error popup that says The game module 'CppQuickstartEditor' could not be successfully initialized after it was loaded. I cannot find any more detailed info in the logs than that.

This is basically just an empty module for right now, with what I believe should be the bare minimum to get the engine to load it, however I do not know if there was something that changed in 5.1 from 5.0 that is missing from the tutorial that I am following along with. The .log file provides no further context for why it fails to initialize so I don’t even really know where to start looking for the problem.

Any help is greatly appreciated

Code Snips

Added to CppQuickstart.uproject:

		{
			"Name": "CppQuickstartEditor",
			"Type": "Editor",
			"LoadingPhase": "PostEngineInit"
		}

In CppQuickstartEditor.Target.cs

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class CppQuickstartEditorTarget : TargetRules
{
	public CppQuickstartEditorTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
		ExtraModuleNames.AddRange( new string [] {"CppQuickstart", "CppQuickstartEditor"} );
	}
}

In CppQuickstartEditor.Build.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class CppQuickstartEditor : ModuleRules
{
	public CppQuickstartEditor(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "CppQuickstart" });

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

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}

In CppQuickstartEditor.h:

#pragma once

#include "Engine.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
#include "UnrealEd.h"

DECLARE_LOG_CATEGORY_EXTERN(CppQuickstartEditor, All, All)

class FCppQuickstartEditorModule: public IModuleInterface
{
public:
    //void StartupModule() override;
    //void ShutdownModule() override;
};

In CppQuickstartEditor.cpp:

#include "CppQuickstartEditor.h"
#include "Modules/ModuleManager.h"
#include "Modules/ModuleInterface.h"

IMPLEMENT_GAME_MODULE(FCppQuickstartEditorModule, CppQuickstartEditor);

Update:
It was a file naming issue…

CppQuickstartEditor.cpp was actually named CppQuickstartEditor cpp and so it was an extensionless file. Visual Studio was still compiling a .dll and placing it in the binaries, but presumably it was just a shell of a .dll with nothing in it since there was no valid .cpp implementation for it. UnrealEngine was able to load this empty .dll because it did in fact exist, but could not initialize because it was empty.

1 Like