x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UnrealEd included in build despite Editor module

Hi there,

I'm currently working in a small example project to test some ideas I have about some editor code for my main project. One of the things I wanted to focus on was make sure everything I was doing is buildable, and that I had established the right process for maintaining editor code.

I've created a separate editor module with my editor specific code in it, and the build.cs for my editor includes UnrealEd, however when I build my project I'm getting a raft of errors relating to it, the only way I can get it to avoid these errors is by simply commenting out my editor module in my project's target.cs. I would've assumed "if(bBuildEditor)" to be false in development builds, but I'm now guessing it's not? If that, then, is the case, what is the query I should be using to ensure my editor is not included even in development builds of the game, but still in development editor?

Here's an example of the kind of errors I'm getting for the build:

 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(31): error C2039: 'GetGraph': is not a member of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Classes\EdGraph/EdGraphNode.h(171): note: see declaration of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(31): error C2039: 'GetSchema': is not a member of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Classes\EdGraph/EdGraphNode.h(171): note: see declaration of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(31): error C2227: left of '->IsCacheVisualizationOutOfDate' must point to class/struct/union/generic type
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(54): error C2039: 'GetGraph': is not a member of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Classes\EdGraph/EdGraphNode.h(171): note: see declaration of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(57): error C2039: 'GetSchema': is not a member of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Classes\EdGraph/EdGraphNode.h(171): note: see declaration of 'UEdGraphNode'
 U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public\EdGraph/EdGraphNodeUtils.h(57): error C2227: left of '->GetCurrentVisualizationCacheID' must point to class/struct/union/generic type
 U:\UnrealEngine-4.17.2\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(180): error C3668: 'UK2Node::ReconstructNode': method with override specifier 'override' did not override any base class methods
 U:\UnrealEngine-4.17.2\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(181): error C3668: 'UK2Node::GetNodeTitleColor': method with override specifier 'override' did not override any base class methods

for context here's my projects files:

Uproject:

 {
     "FileVersion": 3,
     "EngineAssociation": "{92C5AC8E-4175-8E02-07FE-01BC4C19F361}",
     "Category": "",
     "Description": "",
     "Modules": [
         {
             "Name": "NoteTest",
             "Type": "Runtime",
             "LoadingPhase": "Default",
             "AdditionalDependencies": [
                 "Engine"
             ]
         },
         {
             "Name": "NoteTestEditor",
             "Type": "Editor",
             "LoadingPhase": "PostEngineInit"
         }
     ]
 }

Project Target.cs

 using UnrealBuildTool;
 using System.Collections.Generic;
 
 public class NoteTestTarget : TargetRules
 {
     public NoteTestTarget(TargetInfo Target) : base(Target)
     {
         Type = TargetType.Game;
         ExtraModuleNames.Add("NoteTest");
         
         if (UEBuildConfiguration.bBuildEditor)
         {
             ExtraModuleNames.AddRange(new string[]{"NoteTestEditor"});
         }
     }
 }
 

Editor target.cs

 using UnrealBuildTool;
 using System.Collections.Generic;
 
 public class NoteTestEditorTarget : TargetRules
 {
     public NoteTestEditorTarget(TargetInfo Target) : base(Target)
     {
         Type = TargetType.Editor;
         ExtraModuleNames.AddRange(new string[]{"NoteTest", "NoteTestEditor"});
     }
 }
 

Project Build.cs:

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

Editor Build.cs

 using UnrealBuildTool;
 
 public class NoteTestEditor : ModuleRules
 {
     public NoteTestEditor(ReadOnlyTargetRules Target) : base(Target)
     {
         PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
 
         PublicDependencyModuleNames.AddRange(new string[] {
             "NoteTest",
             "Core",
             "InputCore"});
 
         PrivateDependencyModuleNames.AddRange(new string[] {
             "CoreUObject",
             "Engine",
             "AssetTools",
             "DetailCustomizations",
             "EditorStyle",
             "PropertyEditor",
             "Slate",
             "SlateCore",
             "MainFrame",
             "UnrealEd"});
         
         PublicIncludePaths.AddRange(new string[]{"NoteTestEditor/Public"});
 
         PrivateIncludePaths.AddRange(new string[]{
             "NoteTestEditor/Private",
             "Editor/DetailCustomizations/Private",
             "EditorStyle",
             "PropertyEditor"});
     }
 }

I don't believe any of the files here are setup in an incorrect manner, though I may be wrong in that assumption.

A related query I have is, what is the distinction between AdditionalDependencies in UProject and adding items in the build.cs? I was previously adding a lot more in AdditionalDependencies, but realised it wasn't necessary, but I can't find anything from Google that explains the distinction.

Product Version: UE 4.17
Tags:
more ▼

asked Oct 05 '17 at 11:20 AM in Packaging & Deployment

avatar image

Ungalyant
100 10 15 22

avatar image phantomono2 Nov 09 '17 at 07:08 PM

Hello, I'm having the exact same issue. Were you able to figure this out yet? I can't determine where the editor is being included that causes these compile errors. Mine are identical to yours and I have mine setup in the same way.

avatar image Ungalyant Nov 28 '17 at 11:57 AM

I BELIEVE (although I haven't tested this in a while now as I've been worrying about other things) that you should be able to check the target type for whether or not you include the editor:

         Type = TargetType.Game;
         ExtraModuleNames.Add("MyGame");
         
         if (Type == UnrealBuildTool.TargetType.Editor)
         {
             ExtraModuleNames.AddRange(new string[]{"MyGameEditor"});
         }

Though off the top of my head I think there were still some issues with this so I think I ended up going manual and getting around the issue by stripping out the editor code whenever we make a build, something I'm really not happy about, but it's not an issue I have the time to investigate at the moment sadly. I can confirm that bBuildEditor will still be true when doing a build (development at the very least) even though #WITH_EDITOR should be false in this scenario.

avatar image DanHollingsworth Apr 17 '18 at 07:24 PM

UnrealEd? "U:\UnrealEngine-4.17.2\Engine\Source\Runtime\Engine\Public"

This is Runtime Engine code. I have the same exact failure and was hoping you found the problem?

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first
more ▼

answered Oct 08 '17 at 12:29 PM

avatar image

GS_Aero
16 2 3

avatar image Ungalyant Oct 09 '17 at 01:03 PM

Hey, thanks for the response, sorry, I'm not quite sure what you mean by this. I too followed this tutorial, and I had a little look at the code in your repository and it's quite similar to my own. Is there something you're referring to that I'm missing? Is there a section in the tutorial or in your source code that would answer either of my queries?

  • What exactly bBuildWithEditor does, and if the code IS included with development packaged projects, what query to use instead

  • The difference between additional dependencies in UProject and including items in the build.cs

If I uncomment out the "UnrealEd" line in your editor build.cs I get the same error as my own, so is your answer that I should simply comment out includes? That's a process that seems a little too manual, and I'd rather avoid if possible.

avatar image DanHollingsworth Apr 17 '18 at 09:13 PM

For me this turned out to be a Module Dependency in the build.cs of a runtime module on an editor module. You will not find an include to comment out, as the .h file is passed to the build tool on the command line.

avatar image Ghar Apr 24 '18 at 10:01 PM

What dependency was missing in your build file?

avatar image DanHollingsworth Apr 24 '18 at 11:45 PM

It was not missing. We have an Editor only module. And someone had ADDED it to the primary Game module. PrivateDependency list. Editor needs to know what the game code does. But not the other way around. We have a bunch of #if WITH_EDITOR code chunks that rely on the Editor Module. So adding code in the build CS to only add that if its building an editor.

 public class MyClass : ModuleRules
 {
     public MyClass (ReadOnlyTargetRules Target) : base(Target)
     {
 
         PublicDependencyModuleNames.AddRange(new string[] 
         { "Core"
         , "CoreUObject"
         , "Engine"
         , "InputCore"
         });
 
         PrivateDependencyModuleNames.AddRange(new string[] 
         {
         });
 
         if (Target.bBuildEditor) // <--- this is needed so we only include the EditorModules in an Editor Build.
         {
             PrivateDependencyModuleNames.AddRange(new string[]
             {
                 "UnrealEd"
             ,   "MyEditorModule"  // <--- this is needed to call the editor functions when building an editor.  BUt should not be part of the final game.
             });
 
             PrivateIncludePaths.AddRange(new string[]
             {
                 "MyEditorModule",
             });
         }
     }
 }

avatar image Ghar Apr 25 '18 at 01:45 PM

Thank you! It was a little bit different in my case, but you helped me understand the problem:

In GameName.Target.cs file I didn't need to include the Editor Module.

 using UnrealBuildTool;
 using System.Collections.Generic;
 
 public class GameNameTarget : TargetRules
 {
     public GameNameTarget(TargetInfo Target) : base(Target)
     {
         Type = TargetType.Game;
 
         ExtraModuleNames.AddRange(new string[] { "GameName" });
 
         ExtraModuleNames.Add("GameNameEditor"); // <----- Had removed this line
     }
 }
avatar image Ghar Apr 25 '18 at 01:46 PM

I had to remove that line ***

avatar image DanHollingsworth Apr 25 '18 at 03:52 PM

yeah they could catch this in the build tool. All they have to do is check if the module being depended on is an editor module or not. Would be a much better error message than the weird compiler errors.

Glad you got it fixed.

avatar image DanHollingsworth Apr 24 '18 at 11:46 PM

If this is the issue you are having, then the editor builds fine, and you get those weird errors only when building the standalone game.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question