Download

Can not compile editor module

Hi! I have editor module set up just fine. And it compiles, as long as I do not reference any eidtor-related classes, like ‘Blutility’ or ‘UnrealEd’. The moment I add those to my EditorModule.build.cs, I start getting errors like:


11>PCH.UnrealEd.cpp
11>F:\Program Files\Epic Games\UE_Git4.17\Engine\Source\Developer\SharedSettingsWidgets\Public\SExternalImageReference.h(8): fatal error C1083: Cannot open include file: 'PropertyHandle.h': No such file or directory
11>Module.BlueprintProfiler.cpp
11>F:\Program Files\Epic Games\UE_Git4.17\Engine\Source\Developer\BlueprintProfiler\Public\BlueprintProfiler.h(7): fatal error C1083: Cannot open include file: 'TickableEditorObject.h': No such file or directory

e.t.c.

I wasted whole day trying different bunch of stuff with no real soliution.

I am under Unreal 4.17, my module build file looks like this:


// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;

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

        PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "GAME", "AnimGraph", "UnrealEd", "BlueprintGraph" });

        PrivateDependencyModuleNames.AddRange(
            new string]
            {

            });

        PublicIncludePaths.AddRange(
            new string]
            {
                "GAMEEditor/Public"
            });

        PrivateIncludePaths.AddRange(
            new string]
            {
        "GAMEEditor/Private"
        });


    }
}


Game.target.cs


using UnrealBuildTool;
using System.Collections.Generic;

public class GAMETarget : TargetRules
{
    public GAMETarget(TargetInfo Target) : base(Target)
    {
        Type = TargetType.Game;

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

        if (UEBuildConfiguration.bBuildEditor == true)
        {
            ExtraModuleNames.AddRange(
                new string]
                {
                    "GAMEEditor"
                });
        }        

    }
}

GAMEEditor.target.cs


using UnrealBuildTool;
using System.Collections.Generic;

public class
GAMEEditorTarget : TargetRules
{
    public GAMEEditorTarget(TargetInfo Target) : base(Target)
    {
        Type = TargetType.Editor;

        ExtraModuleNames.AddRange( new string] { "GAME", GAMEEditor" } );



    }
}

uproject file


....
    "FileVersion": 3,
    "EngineAssociation": "{0D895E0E-4ECB-40B3-DF32-2F892FD3C93E}",
    "Category": "",
    "Description": "",
    "Modules": 
        {
            "Name": "GAME",
            "Type": "Runtime",
            "LoadingPhase": "Default"
        },
        {
            "Name": "GAMEEditor",
            "Type": "Editor",
            "LoadingPhase": "PostEngineInit"
        }
    ],
...

Any help is very appreciated, I am stuck for good with this one

Not related to your problem, but this part:



if (UEBuildConfiguration.bBuildEditor == true)
{
    ExtraModuleNames.AddRange(
        new string]
        {
            "GAMEEditor"
        });
} 


doesn’t do anything. If you compile your project for the editor, it will execute the editor target.cs file. The non-editor target.cs file is only executed if you build without the editor, so bBuildEditor is always going to be false.

Ah, I see, thank you, fill remove that one just for sanity case. Probably artifact from the older UE version, from your reply sounds like that editor just has its separate build file now and that is enough

EDIT: OMG! Removing that actually allowed me to compile just fine 0____0 Ohhhh “thank” you google, that part always pops up in search, it never occurred to me that this might be the issue

THANKS!!

Now that’s a new one…
Maybe some build data was outdated and editing that file triggered a regeneration. For science, if you put it back, does it still build?

No, it does not. Seems to be stable reproduced issue, at least for me

That’s very strange, the Game.Target.cs shouldn’t even be executed when building for the editor.