Fatal error C1083: Cannot open include file: 'K2Node.generated.h'

Rebuilding a 4.7 plugin in 4.10 I’m seeing this error:

1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(7): fatal error C1083: Cannot open include file: ‘K2Node.generated.h’: No such file or directory

The file exists at:

C:\Program Files\Unreal Engine\4.10\Engine\Intermediate\Build\Win64\UE4Editor\Inc\BlueprintGraph/K2Node.generated.h

But the compiler doesn’t see it.

Have you tried regenerating your project files?

“C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h” is not the same location as “C:\Program Files\Unreal Engine\4.10\Engine\Intermediate\Build\Win64\UE4Editor\Inc\BlueprintGraph/K2Node.generated.h”.
Copy or move(This may cause errors.) the file from “C:\Program Files\Unreal Engine\4.10\Engine\Intermediate\Build\Win64\UE4Editor\Inc\BlueprintGraph/K2Node.h” to “C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h”. The compiler is in a fixed directory regardless the file is near by. In “BlueprintGraph” folder there is a folder called “Classes”.

Instead of copying the generated file I set the path in …Build.cs:

PrivateIncludePaths.Add("C:/Program Files/Unreal Engine/4.10/Engine/Intermediate/Build/Win64/UE4Editor/Inc/BlueprintGraph");

This works, no more errors finding K2Node.generated.h. However, lots of errors in UE headers:

2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(54): error C2614: 'FOptionalPinFromProperty': illegal member initialization: 'PropertyTooltip' is not a base or member
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(105): error C3668: 'UK2Node::ReconstructNode': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(106): error C3668: 'UK2Node::GetNodeTitleColor': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(107): error C3668: 'UK2Node::AutowireNewNode': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(108): error C3668: 'UK2Node::PinConnectionListChanged': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(109): error C3668: 'UK2Node::GetJumpTargetForDoubleClick': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(110): error C3668: 'UK2Node::GetDocumentationLink': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(111): error C3668: 'UK2Node::GetPinHoverText': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(112): error C3668: 'UK2Node::ShowPaletteIconOnNode': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(113): error C3668: 'UK2Node::AllowSplitPins': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(114): error C3668: 'UK2Node::GetPassThroughPin': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(220): error C3668: 'UK2Node::CanCreateUnderSpecifiedSchema': method with override specifier 'override' did not override any base class methods
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\BlueprintGraph\Classes\K2Node.h(147): error C3861: 'GetNodeTitle': identifier not found
2>C:\Program Files\Unreal Engine\4.10\Engine\Source\Runtime\Core\Public\Async\AsyncWork.h(321): error C2039: 'GetStatId': is not a member of 'ExampleAutoDeleteAsyncTask'

Now what?

:

I’ve also tried re-installing 4.10, verifying, regenerating the solution files, rebooting. Nothing helps.

It seems illogical that it’s necessary to add a custom path in order to find part of UE, that it must be a UE configuration/installation issue. I’ve exhausted everything I can think of to try with that.

Ideas?

Are you using a custom k2Node? Also please try to add comments not answers, if not it will be hard to follow the issue.

Any luck with this? I’m trying to inherit from UAnimGraphNode_Base, and AnimGraphNode_Base.generated.h can’t be found…

1 Like

If your plugin compiles for target DevelopmentEditor but not for Development may be creating an additional editor module helps:

  1. A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
  2. A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
  3. https://answers.unrealengine.com/questions/41509/extending-editor-engine.html

As a workaround you could also try guarding the editor specific code with the define WITH_EDITOR and UEBuildConfiguration.bBuildEditor in the build.cs like here:

  1. UnrealEd Dependency Causes Package Failure - C++ - Unreal Engine Forums

Sorry for posting in such an old thread but I had a similar problem and wanted to share my solution.

I made my own custom K2Node which will work fine inside the editor. However when I tried launching the game or compiling for Development or Shipping I would get the “Cannot open K2Node.generated.h” error.

The solution was to add the required module to the PUBLIC dependency modules. For K2Nodes that would be BlueprintGraph.

1 Like

I had compile errors while inheriting UAnimGraphNode_Base, and this solved my problem. Thanks!