Compile as DLL

Hi, I’m trying to build a project as library (DLL) according to this doc:

My procedure was as follows:

  1. I’ve created a new blank C++ project named TestLib.

  2. I’ve modified the TestLibEditor.Target.cs file as was described in the doc page, so now it loosk like:

using UnrealBuildTool;
using System.Collections.Generic;

public class TestLibTarget : TargetRules
{
public TestLibTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.AddRange( new string[] { “TestLib” } );
GlobalDefinitions.Add(“UE_LIBRARY_ENABLED=1”);
LinkType = TargetLinkType.Monolithic;
bShouldCompileAsDLL = true;
}
}

  1. Now I’m trying to build it as Development Editor (Win64), but I get allways same error:
    TestLibEditor modifies the value of bShouldCompileAsDLL. This is not allowed, as TestLibEditor has build products in common with UE4Editor.

I’ve tried it in UE 4.27.2 and UE 5.0.1 with the same result. Could you please give me a hint about what I’m doing wrong?

Thank you.

If we want to build project as dll, we should use an unreal engine built from GitHub source code.
I am also actively trying to compile a game as a DLL. Are you still doing this?