Duplicate class name: UK2Node_BaseAsyncTask

If using “AnimGraph” module in a vanilla project a compilation error arises: LogCompile : error : Duplicate class name: UK2Node_BaseAsyncTask also exists in file /Script/OnlineBlueprintSupport

Environment: Unreal Engine 4.3 / Visual Studio Professional 2013 / 64bit

Reproduction:

  • UE4: Create New Project as Blank
  • UE4: File > Add Code To Project… > BaseClass: AnimGraphNode_SkeletalControlBase
  • VisualStudio: Compile
  • VisualStudio: Expected Error: D:/UE4/Projects.4.3/Demo/Source/Demo/MySkeletalControlBase.h(11): error : Superclass AnimGraphNode_SkeletalControlBase of class MySkeletalControlBase not found
  • VisualStudio: Adding “AnimGraph” to PublicDependencyModuleNames array in …Build.cs
  • VisualStudio: Unexpected Error: LogCompile : error : Duplicate class name: UK2Node_BaseAsyncTask also exists in file /Script/OnlineBlueprintSupport

Content of PublicDependencyModuleNames array: “Core”, “CoreUObject”, “Engine”, “InputCore”, “AnimGraph”

Anyone has any clue of what is wrong on this procedure?

Hi JoseFelix,

Can you please confirm that you are using the binary version of the Engine installed through the Launcher?

  • On the launcher I click con 4.3.0, then verify and a popup shows me modified files ‘\UE4\Unreal Engine\Launcher\Backup\UE_4.3Production-Windows[2014.07.23-20.43.21]\Engine\Programs\ShaderCompileWorker\Saved\Config\CleanSourceConfigs’
  • After the second verify a no popup is shown and a quick message ‘clean up’ had been shown in the laund button.
  • If I try to open the project a recompiling of code is requested and fails (in the log appears the same error)
  • If I try to open the project anyway, UE4 crashes.
  • If I open VS2013 and try to recompile the solution same error appears.
  • If I verify UE4.3.0 no error appears (but still the VS compiling error)
  • I’m using UE4.3.0 directly from the launcher, not using the UE source code.

Just before this, I tried to migrate a project from 4.2.1 (working and compiling fine) to 4.3.0 vía launcher, and failed. So I decided to migrate the code manually. Then this happened.

Hi JoseFelix,

I apologize for the delay in getting back to you. I was unable to reproduce the issue that you described, but I was using version 4.3.1 from the Launcher. Do you still have the same issue with version 4.3.1?

Don’t worry. I’ve removed the version 4.3. Reinstalled a fresh new 4.3.1 and still the same error. BlankProject (wo starter content), new class parent UAnimGraphNode_SkeletalControlBase, in VS adding to build.cs “AnimGraph” at PublicDependencyModuleNames, and compiling with Development_Editor x64.

1>------ Build started: Project: Demo, Configuration: Development_Editor x64 ------
1> Parsing headers for DemoEditor
1>LogTextLocalizationManager : warning : The selected culture ‘es_ES’ is not available; falling back to ‘en’
1>LogCompile : error : Duplicate class name: UK2Node_BaseAsyncTask also exists in file /Script/OnlineBlueprintSupport
1>D:/UE4/Unreal Engine/4.3/Engine/Source/Editor/OnlineBlueprintSupport/Classes/K2Node_LatentOnlineCall.h(8): error : Superclass K2Node_BaseAsyncTask of class K2Node_LatentOnlineCall not found
1>D:/UE4/Unreal Engine/4.3/Engine/Source/Editor/OnlineBlueprintSupport/Classes/K2Node_LeaderboardFlush.h(7): error : Superclass K2Node_BaseAsyncTask of class K2Node_LeaderboardFlush not found
1>D:/UE4/Unreal Engine/4.3/Engine/Source/Editor/OnlineBlueprintSupport/Classes/K2Node_LeaderboardQuery.h(7): error : Superclass K2Node_BaseAsyncTask of class K2Node_LeaderboardQuery not found
1>D:/UE4/Unreal Engine/4.3/Engine/Source/Editor/BlueprintGraph/Classes/K2Node_AIMoveTo.h(9): error : Superclass K2Node_BaseAsyncTask of class K2Node_AIMoveTo not found
1>Error : Failed to generate code for DemoEditor - error code: 2
1> UnrealHeaderTool failed for target ‘DemoEditor’ (platform: Win64, module info: D:\UE4\Projects.4.3\Demo\Intermediate\Build\Win64\DemoEditor\Development\UnrealHeaderTool.manifest).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““D:\UE4\Unreal Engine\4.3\Engine\Build\BatchFiles\Build.bat” DemoEditor Win64 Development “D:\UE4\Projects.4.3\Demo\Demo.uproject” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I’m having a similar problem on both 4.3.0 and 4.3.1. Adding “AnimGraph” as a dependency on an empty project generates:
1>LogCompile : error : Duplicate class name: UEdGraphSchema_K2 also exists in file /Script/AnimGraph
1>LogCompile : error : Duplicate class name: UK2Node also exists in file /Script/AnimGraph
1>LogCompile : error : Duplicate class name: UK2Node_BaseAsyncTask also exists in file /Script/OnlineBlueprintSupport

I got this to work by adding “UnrealEd” in the list of dependencies. As I understand, AnimGraph is only to be used in editor modules anyway.

They seem to be in AnimGraph so I’m not sure. This is my *Editor.Build.cs:

	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine" });
	PrivateDependencyModuleNames.AddRange(new string[] { "Game", "UnrealEd", "AnimGraph", "BlueprintGraph" });

(About creating a separate Editor specific project: How can we Ship Games that use custom animation nodes? - Character & Animation - Epic Developer Community Forums)

Adding PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “UnrealEd”, “AnimGraph” }); compiles fine but throws linker errors:

1> [7/7] link.exe UE4Editor-Demo.dll
1> Creating library D:\UE4\Projects.4.3\Demo\Intermediate\Build\Win64\DemoEditor\Development\UE4Editor-Demo.lib and object D:\UE4\Projects.4.3\Demo\Intermediate\Build\Win64\DemoEditor\Development\UE4Editor-Demo.exp
1>MyClass.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FText __cdecl UAnimGraphNode_SkeletalControlBase::GetControllerDescription(void)const " (?GetControllerDescription@UAnimGraphNode_SkeletalControlBase@@MEBA?AVFText@@XZ)
1>Demo.generated.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FText __cdecl UAnimGraphNode_SkeletalControlBase::GetControllerDescription(void)const " (?GetControllerDescription@UAnimGraphNode_SkeletalControlBase@@MEBA?AVFText@@XZ)
1>MyClass.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl UK2Node::AllowSplitPins(void)const " (?AllowSplitPins@UK2Node@@UEBA_NXZ)
1>Demo.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl UK2Node::AllowSplitPins(void)const " (?AllowSplitPins@UK2Node@@UEBA_NXZ)
1>MyClass.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl UK2Node::AutowireNewNode(class UEdGraphPin *)” (?AutowireNewNode@UK2Node@@UEAAXPEAVUEdGraphPin@@@Z)
1>Demo.generated.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl UK2Node::AutowireNewNode(class UEdGraphPin *)” (?AutowireNewNode@UK2Node@@UEAAXPEAVUEdGraphPin@@@Z)
1>MyClass.cpp.obj…

Maybe it’s necessary to add more dependencies for “AnimGraphNode_SkeletalControlBase” ?

I notice a private/public difference between our versions but I didn’t really get the difference. Also, what is your .h/cpp code ? Are you sure this link error is not from your own custom class ?

This also seems not working for me. The configuration using is “Development_Editor” so the solution avobe should not be necessary.

This is my Demo.Build.cs:
PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “UnrealEd”, “BlueprintGraph”, “AnimGraph” });
PrivateDependencyModuleNames.AddRange(new string[] { });

And still an error:
1> [3/3] link.exe UE4Editor-Demo.dll
1> Creating library D:\UE4\Projects.4.3\Demo\Intermediate\Build\Win64\DemoEditor\Development\UE4Editor-Demo.lib and object D:\UE4\Projects.4.3\Demo\Intermediate\Build\Win64\DemoEditor\Development\UE4Editor-Demo.exp
1>MyClass.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FText __cdecl UAnimGraphNode_SkeletalControlBase::GetControllerDescription(void)const " (?GetControllerDescription@UAnimGraphNode_SkeletalControlBase@@MEBA?AVFText@@XZ)
1>Demo.generated.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class FText __cdecl UAnimGraphNode_SkeletalControlBase::GetControllerDescription(void)const " (?GetControllerDescription@UAnimGraphNode_SkeletalControlBase@@MEBA?AVFText@@XZ)
1>D:\UE4\Projects.4.3\Demo\Binaries\Win64\UE4Editor-Demo.dll : fatal error LNK1120: 1 unresolved externals

Is it necessary to follow this https://answers.unrealengine.com/questions/55385/how-can-we-ship-games-that-use-custom-animation-no.html?sort=newest eventhough i’m not in a “shipping game” configuration. Is there any missing module left to add?

yes, I’ve tried both and also didn’t work:

using UnrealBuildTool;

public class Demo : ModuleRules
{
	public Demo(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore"});

        PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "BlueprintGraph", "AnimGraph" });
.........

And the code of "MyClass.h/.cpp":
#pragma once

#include "AnimGraphNode_Base.h"
#include "AnimGraphNode_SkeletalControlBase.h"
#include "MyClass.generated.h"

/**
 * 
 */
UCLASS()
class DEMO_API UMyClass : public UAnimGraphNode_SkeletalControlBase
{
	GENERATED_UCLASS_BODY()

	
	
};

#include "Demo.h"
#include "MyClass.h"


UMyClass::UMyClass(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{

}

The problem is that the linker can’t find the base class “AnimGraphNode_SkeletalControlBase”

Right. I’m not deriving UAnimGraphNode_SkeletalControlBase but UAnimGraphNode_Base directly, but both are dll exported on the AnimGraph module, so it’s strange. I’m with 4.3.1.

I’ve also don’t have any clue, but that’s why I wrote exactly that procedure. Because it fails. And it’s very simple to reproduce (at least for me). I assume that the solucion would be quite simple, like adding something in somewhere, but I don’t know either.

Hello JoseFelix,

I’m cleaning up old unanswered issues. Are you still having trouble with this?

I haven’t tried that since summer. As new versions of UE4 had appear since then, probably it’s solved but it would be fine to be tested. Also, as few people have not had any issues, probably, the problem is isolated. As far as for me, the issue is closed.

I get the same problem as soon as I add the BlueprintGraph in my Public Dependencys on my Editor Module for my project…

Everyone got anything new on the subject?

Im using 4.6.1 by the way.

Ok so I had the same problem when I added the BlueprintGraph dependency, and it worked when I added i to my Circularly Referenced Dependent Modules…

So My Code now looks like this

PublicDependencyModuleNames.AddRange(new string[] {
 "Core",
 "CoreUObject",
 "Engine",
 "InputCore",
 "BlueprintGraph"
 }
);


    CircularlyReferencedDependentModules.AddRange( new string[] { "BlueprintGraph" }
    ); 

Tested on my main project and a new blank code project, Hope it helps…