Download

Getting errors when trying to add an editor module

I’m trying to add some editor code by following this tutorial How to Make Tools in UE4 - Eric's Blog. I’ve created all the necessary files, but when I compile the solution, I’m getting an error saying “Could not find definition for module MyModule”. This is the only error.

If I try to comment out the line adding the module ( ExtraModuleNames.AddRange() in ProjectEditor.Target.cs), I instead see a bunch of linking errors. Looks like a bunch of symbols get defined in both the project and the editor module and conflict somehow? I’m assuming that the module fails to link and that’s why its definition can’t be found when it’s required.

If I instead download the completed project with the module already defined from github it does work, but I need to understand what I’m doing wrong. As far as I can tell, I went through exactly the same steps in a differently-named project.

Nevermind, found the problem: the code was correct, but my folder structure did not match the tutorial

Nice! Could you perhaps post a before and after so that others might see the solution on this post?

More specifically, I had

Source
  + Project
    | Project.build.cs
    + Module
      | Module.build.cs

while the correct folder structure is

Source
  + Project
     | Project.build.cs
  + Module
     | Module.build.cs
1 Like