[4.9] [Plugin Templates Bug] Plugins that use UnrealEd dependency dont compile

Dear Epic,

#The New Template Plugins Dont Compile

#Repro Case

  1. Create a new plugin using the new editor plugins “New Plugin” button.

  2. Make it the middle option, to create a plugin that adds a button to the Level Editor toolbar.

  3. You’ll see an error pop up saying the code could not be compiled.

  4. If you try to then compile your project where you added the plugin code, you’ll get this error:

    C:\Program Files\Epic Games\4.9\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: ‘AssetEditorMessages.generated.h’: No such file or directory

  5. In your project’s build cs make sure to include your new plugin as a depedency so that it gets compiled.

  6. Successive compiles for development win64 will produce the error if you did not see it the first time.

#If You Dont See The Error

Please delete your plugin binaries and recompile your project that contains the plugin template code, for Development Win64, and you will see the error if it did not show the first time.

#More info

I extend UnrealEdEngine for my Vertex Snap Editor plugin, and in 4.9 it will not compile because including UnrealEd is not working due to what seems like an intenral error.

class UVictoryEdEngine : public UUnrealEdEngine
{

All the way until 4.9 this was the build CS:

#Build CS

// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class VictoryEdEngine : ModuleRules
{
    public VictoryEdEngine(TargetInfo Target)
    {
        PublicDependencyModuleNames.AddRange(
            new string[] { 
				"Core", 
				"CoreUObject", 
				"Engine", 
				"InputCore",
				"UnrealEd",		//<~~~~
				"Slate",
                "SlateCore",
                "ImageWrapper"
			}
		);
    }
}

#Compile Error

1>C:\Program Files\Epic Games\4.9\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: 'AssetEditorMessages.generated.h': No such file or directory

#Summary

I make no mention of AssetEditorMessages anywhere in my code base, it seems to be internal to UnrealEd module

I did a file search and “AssetEditorMessage” is literally not mentioned anywhere in my entire plugin code :slight_smile:

#Question

Is there another way I can extend UnrealEdEngine?

#Looked at 4.9 Plugin Template

In the 4.9 plugin template UnrealEd is included as a private dependency, I tried changing my UnrealEd dependency to private in the build.cs but that did not improve anything.

EDIT: 4.9 plugins created from template dont compile either! Same error message!

Anyone at Epic have any insight on this matter?

#Thanks!

Hey -

I followed the steps you listed and did not have any issues with compiling after creating the new plugin. Here are the steps I took:

  1. Created new C++ First Person Template project
  2. Edit->Plugins->New Plugin
  3. Toolbar Button ->Named the plugin->Create plugin

At this point I received a prompt that the editor project and VS needed to be restarted to make updates including the plugin (adding the code to solution and adding the button to the editor). Compiling the solution worked properly and deleting the plugin’s binaries folder did not cause any issues with compile either.

Can you confirm this happens in a new project? If so please let me know what I’ve done differently and how I can reproduce this compile issue.

Cheers

#Repro

Dear ,

I got the exact same error in a new project, here is my repro for you + a picture of the immediate most obvious error that is in-editor

  1. Make new C++ project, third person template
  2. After compiling, open editor, go to Edit->Plugins
  3. New Plugin
  4. Select the middle option, add button to level editor viewport
  5. Choose a name and make the plugin

#Error Message In-Editor

I immediately see an error message when I do this (4.9.0)

#BuildCS

The immediate errors are actually referring to the template’s build cs

6 Window->DeveloperTools->Output Log shows this

Running C:/Program Files/Epic Games/4.9/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="C:/Users//Documents/Unreal Projects/Joy/Joy.uproject" -game -rocket -progress
Discovering modules, targets and source code for game...
Errors detected while compiling C:\Users\\Documents\Unreal Projects\Joy\Intermediate\Build\BuildRules\JoyModuleRules.dll:
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(5,14) : error CS1001: Identifier expected
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(5,14) : error CS1513: } expected
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(7,9) : error CS1518: Expected class, delegate, enum, interface, or struct
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(11,8) : error CS1518: Expected class, delegate, enum, interface, or struct
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(11,15) : error CS1001: Identifier expected
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(11,17) : error CS1518: Expected class, delegate, enum, interface, or struct
c:\Users\\Documents\Unreal Projects\Joy\Plugins\49Template\Source\49Template\49Template.Build.cs(15,4) : error CS1022: Type or namespace definition, or end-of-file expected
ERROR: UnrealBuildTool encountered an error while compiling source files
LogPluginWizard: Failed to generate project files.

#4.9.0 Release

Again all my tests are with the 4.9.0 release, regular launcher build (not github)

#Thanks!

Nice to hear from you !

#:heart:

#Error 1 Solved

Dont allow plugin names to start with numbers

My initial plugin test was named 49plugin, this is what caused the build cs errors.

#Ticket Request

I do think a ticket should be made to disallow plugin names that start with numbers to avoid this error.

#Packaging Error Development 64

Continuing with the repro steps (with a name that does not contain numbers)

  1. Restart editor now that new plugin has been created, compile source code when prompted
  2. Try to package the game for Development Win64
  3. I get this packaging error every time, even after restarting again ( keep in mind original project was Third Person Template C++

(see attached file)link text

The core error lines are these:

Failed to load ‘/Engine/Transient’: Can’t find file ‘/Engine/Transient’
Failed to find object ‘Class /Engine/Transient.REINST_ThirdPersonOverview_C_117’

Please note I tried closing and reopening editor and repackaging several times, no hot-reloads involved.

4 Now close editor, remove plugins by adding a _ to the end of plugins directory name.

5 Reopen editor and package, packging works fine!

#Conclusion

I can’t even get back to my original error that is the focus of this thread, because adding a new template plugin to the third person project causes packaging to fail for reasons other than my original error.

#Entire Repro Steps for Packaging Error

  1. Make new C++ project, third person template

  2. After compiling, open editor, go to Edit->Plugins

  3. New Plugin

  4. Select the middle option, add button to level editor viewport

  5. Choose a name and make the plugin

  6. Restart editor now that new plugin has been created, compile source code when prompted

  7. Try to package the game for Development Win64

  8. I get the packaging errors every time, even after restarting again ( keep in mind original project was Third Person Template C++

(see attached file in above post)

#Second Repro With Empty C++

I just reproduced the Development win64 packaging error that involves the new plugin templates system a second time with a different UE4 template project!

  1. Make a new Blank project, C++
  2. In new project, make a new plugin, picking the middle option for add button to level viewport
  3. Restart the editor using plugin menu button in lower right
  4. Package the project for Development Win 64

I get the follow packaging error log every time!

See attached file please
link text

A Clue

Weirdly enough, the error is referring to a class that should not even be in the Blank Project.

Failed to find object 'Class /Engine/Transient.REINST_ThirdPersonOverview_C_117'

#Conclusion

I still can’t get to my original error message because I can’t get the project to fully compile its source code because it is erroring out in two different UE4 template projects whenever a plugin created using the new plugin template system is present.

#:heart:

Hey -

It appears this only occurs when creating a plugin that begins with a number. Seeing as neither projects nor classes can have a number at the beginning of their names I have entered a bug to address this (UE-20671).

Cheers

#Packaging Still Failing, Repro Steps

Dear ,

I agree the starting-with-number issue is real and needs to be addressed, however did you try these repro steps of mine?

I am still getting packaging errors using only UE4 template project and plugin code with only-letter plugin names.

  1. Make a new Basic project, C++ called “HappyPlugin” or other name with no numbers in it
  2. In new project, make a new plugin, picking the middle option for add button to level viewport
  3. Restart the editor using plugin menu button in lower right
  4. Package the project for Development Win 64

I get this error log, attached

link text

This is happening with multiple projects having normal names

I am starting new projects each time I test this

The primary error is this:

Failed to find object ‘Class /Engine/Transient.REINST_ThirdPersonOverview_C_117’

I produced this error log just now for the sake of this post

#Clue

The error itself is a giveaway because I created a blank / basic C++ project but it is still looking for something from the Third Person template project.

A new Third person C++ project gets the same error when packaging.

#Request
Please perform my repro above and let me know what result you get!

#Thanks!

Hey -

I’ve also entered a bug to report the packaging process fails after adding a new plugin to the project (UE-20737).

Cheers

Thanks !

:slight_smile: