Incomplete type is not allowed

When using Slate for my Standalone Editor Window Plugin, certain Slate types aren’t allowed.
For example:

SNew(SGraphEditor)
SNew(SListPanel)

Both of these give me the error:

Incomplete type is not allowed

How do I get around this?

Thank you.

Please paste an actual line of code.

The way around it is to include the appropriate header file but since I don’t know the actual name of the “Incomplete type” I can’t tell you which header contains it.

This means that one of header files you included forward reference those types (making them incomplete declarations) but you didn’t include one with full declerations, so you need to include original headers of those types to get there full declerations.

try just “GraphEditor.h” look on header lockation on the end of this page:

TSharedRef FSlateWindowModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
return SNew(SDockTab).TabRole(ETabRole::NomadTab)
[
SNew(SOverlay)

		+ SOverlay::Slot()
		.HAlign(HAlign_Left)
		.VAlign(VAlign_Top)
		[
			SNew(SGraphEditor)
		]			
	];
}

I’ve tried a few includes so far but they deny me access. For example:

“Editor/UnrealEd/Public/GraphEditor.h”,
“UnrealEd/GraphEditor.h”,
“Widgets/Views/SListPanel.h”,

The errors I get look like this:

cannot open source file “UnrealEd/GraphEditor.h”

I had already added that beforehand.
The editor still crashes. :frowning:

Doing that doesn’t cause any errors, but clicking the button causes my editor to crash.

Editor crashes!? That is something… new.

Can you debug the editor by starting it from VS?

You will need to set up some dependencies in your *.build.cs prior using it.

Here is a link to the documentation.

Debugging from Visual Studio gave me this as an error:

Exception thrown at 0x00007FF9EE1957A6 (UE4Editor-Engine.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x00000000000000F4. If there is a handler for this exception, the program may be safely continued.

Lack of depencies cause linker errors not include errors, engine header files are fully accessible regardless

You don’t have your debug symbols loaded. I suspect you have downloaded them along with the engine source?

Also, are you sure you have included:

  • InputCore.h
  • Slate.h
  • SlateCore.h

I have InputCore, Slate, and SlateCore included.

What are debug symbols used for?

Debug symbols are used to link memory addresses of binary files (like 0x00007FF9EE1957A6 (UE4Editor-Engine.dll)) with their source code. I’m sure you can find a better and more in-depth explanation online.

If you have them loaded this error will state the .cpp file and the line where the exception has occurred which will give you some insight of what went wrong. It will also allow you a full debug functionality like step-by-step execution on the engine binaries.

That being said, I don’t think you’ll easily get much information out of this. I’m guessing you are trying to access a member function of a deleted object.

About this: “Doing that doesn’t cause any errors, but clicking the button causes my editor to crash.”

What button are you talking about? Does it have a custom code in it and what is it?

Debug symbols are used to link memory addresses of binary files (like 0x00007FF9EE1957A6 (UE4Editor-Engine.dll)) with their source code. I’m sure you can find a better and more in-depth explanation online.
If you have them loaded this error will state the .cpp file and the line where the exception has occurred which will give you some insight of what went wrong. It will also allow you a full debug functionality like step-by-step execution on the engine binaries.
That being said, I don’t think you’ll easily get much information out of this. I’m guessing you are trying to access a member function of a deleted object.

Ah ok. Thank you. I will look into downloading the symbols to get a better grasp of what I’m working with.

About this: “Doing that doesn’t cause any errors, but clicking the button causes my editor to crash.”
What button are you talking about? Does it have a custom code in it and what is it?

I’ll start from the top:

First, I went to Settings > Plugins.

Next, New Plugin > Editor Standalone Window.

After saving and restarting the editor, it created a new button on my toolbar that opened up a simple window that just had some sample text.

250101-screenshot-25.png

I opened up VS, and the only code I edited was inside the OnSpawnPluginTab function. As you can see, I simply added an SOverlay and then tried to put an SGraphEditor inside of it. If I don’t include “SGraphEditor.h”, I will get red underlined text at the SNew(SGraphEditor) statement saying that the identifier is undefined. If I do include it, everything looks fine and compiles fine.

However, when I click the button I created, the editor crashes.

250103-screenshot-27.png

Fair point…

Then where does my problem reside?

The problem obviously is no longer the incomplete type.

Including GraphEditor.h fixed it and you should accept @anonymous_user_f5a50610 answer.

Now from that point on you have a crash and I’m guessing it’s in SNew(SGraphEditor). I think you are missing a whole bunch of initial settings. Try to remove it just to make sure this breaks your code.

Unfortunately I am not that experienced with slates and editor plugins so I can’t exactly help you on that.

Try to find an example on how SNew(SGraphEditor) is used. (if this indeed is the problem)

Thank you. I will check to see if there are initial settings that are required.

Also, I downloaded the new UE4 version with Debug Symbols. I will run the project from VS. What should I be on the lookout for?