Building a custom plugin leads to Engine compile errors

When I try to compile my plugin, I get the following errors:

As you may have already suggested (while reading the log), I have UE4 installed via Epic Launcher. But I don’t know if that can be the problem… I selected including engine source files when installing it. I also tried to compile UE4 from github sources, but haven’t succeed either (there’s another post: "Derived Data Cache was requested, but not available" error - AnswerHub - Unreal Engine Forums).

My plugin sources: GitHub - mvlabat/ForestGeneratorPlugin: TreeGeneratorPlugin is Unreal Engine 4 plugin for placing trees on terrain randomly.

I don’t state my code there is correct, but I’m not sure there is something wrong with it. It looks like a problem with my setup.

Thanks for any answers in advance.

Thank you! That fixed the error! (Though I’ve got some other errors…) But is it a true way of adding Engine headers to custom plugins? As it is stated

// You should place include statements to your module’s private header files here. You only need to add includes for headers that are used in most of your module’s source files though.

I don’t think it’s a problem with the engine as such - you can get errors showing up in engine code due to how you have used includes and engine types in your own code.

I think if you add

#include "Engine.h"
#include "UnrealEd.h"

to the top of ForestGeneratorPrivatePCH.h, you might find that fixes those initial errors.

Basically, there’s a heap of stuff in the engine that relies on things being included through the precompiled header. It shouldn’t be that way, but the fact is the engine includes are a mess, so you just have to deal with it.