Custom Anim Graph node throws unresolved symbol error

So, I have been trying to implement custom anim nodes, but I have been running into a crapload of problems while trying to implement them with the outdated info found on the UE4 wikis and answerhub. I will probably hurl my PC through the room if I see another unresolved symbol error. :stuck_out_tongue:

Anyways, to get the error out of the way:

Errors:

Severity	Code	Description	Project	File	Line	Suppression State

Error	LNK2019	unresolved external symbol "public: __cdecl FPA_AnimNode_StartCombo::FPA_AnimNode_StartCombo(void)" (??0FPA_AnimNode_StartCombo@@QEAA@XZ) referenced in function "public: __cdecl UPA_AnimGraphNode_StartCombo::UPA_AnimGraphNode_StartCombo(class FObjectInitializer const &)" (??0UPA_AnimGraphNode_StartCombo@@QEAA@AEBVFObjectInitializer@@@Z)	MyGame I:\MyGame\Intermediate\ProjectFiles\PA_AnimGraphNode_StartCombo.cpp.obj	1	

Error	LNK2001	unresolved external symbol "public: __cdecl FPA_AnimNode_StartCombo::FPA_AnimNode_StartCombo(void)" (??0FPA_AnimNode_StartCombo@@QEAA@XZ)	MyGame I:\MyGame\Intermediate\ProjectFiles\MyGameEditor.generated.cpp.obj	1	

Error	LNK1120	1 unresolved externals	MyGame I:MyGame\Binaries\Win64\UE4Editor-MyGameEditor.dll	1	Error		Failed to produce item: I:\MyGame\Binaries\Win64\UE4Editor-MyGameEditor.dll	MyGame	I:\MyGame\Intermediate\ProjectFiles\ERROR	1	

Error	MSB3075	The command ""I:\Game Development\Unreal4\Source\UnrealEngine 4.13.0\Engine\Build\BatchFiles\Build.bat" MyGameEditor Win64 Development "I:MyGame\MyGame.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.	MyGame	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets	37

Anyways, I think the following classes are the root of the problem:

AnimGraphNode.h
Code:

#pragma once

#include "AnimGraphNode_Base.h"
#include "AnimGraphDefinitions.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "PA_AnimNode_StartCombo.h"
#include "PA_AnimGraphNode_StartCombo.generated.h"

UCLASS(MinimalAPI)
class UPA_AnimGraphNode_StartCombo : public UAnimGraphNode_Base
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(EditAnywhere, Category = "Attacks")
		FPA_AnimNode_StartCombo Node;

public:
	virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
	virtual FText GetTooltipText() const override;
	virtual FString GetNodeCategory() const override;
	virtual FLinearColor GetNodeTitleColor() const override;

protected:
	virtual FText GetControllerDescription() const;
	
};

AnimGraphNode.cpp
Code:

#include "MyGame.h"
#include "Editor/AnimGraph/Private/AnimGraphPrivatePCH.h"
#include "AnimationGraphSchema.h"
#include "AnimationRuntime.h"
#include "PA_AnimGraphNode_StartCombo.h"

#define LOCTEXT_NAMESPACE "PA_AnimGraphNode_StartCombo"

UPA_AnimGraphNode_StartCombo::UPA_AnimGraphNode_StartCombo(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{

}

//title color
FLinearColor UPA_AnimGraphNode_StartCombo::GetNodeTitleColor() const
{
	return FLinearColor(0.75f, 0.75f, 0.1f, 1.f);
}

//node category
FString UPA_AnimGraphNode_StartCombo::GetNodeCategory() const
{
	return FString("Placeholder");
}

FText UPA_AnimGraphNode_StartCombo::GetControllerDescription() const
{
	return LOCTEXT("StartComboNode", "Placeholder");
}

//get tooltip
FText UPA_AnimGraphNode_StartCombo::GetTooltipText() const
{
	return LOCTEXT("PA_AnimGraphNode_StartCombo_Tooltip", "Placeholder");
}

//get node title
FText UPA_AnimGraphNode_StartCombo::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	return GetControllerDescription();
}

#undef LOCTEXT_NAMESPACE

I have also made sure to make a seperate editor module for my game, and placed the graph node header and implementation in folder associated with the module. As far as the module goes, this is how it’s been implemented.

GameEditor.Build.cs
Code:

using UnrealBuildTool;

public class MyGameEditor : ModuleRules
{
    public MyGameEditor(TargetInfo Target)
	{
        PublicDependencyModuleNames.AddRange(new string[] {
                    "MyGame"});

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

        PrivateIncludePaths.Add("EditorModule/Private");

        PublicDependencyModuleNames.AddRange(new string[] {
            "Core",
            "CoreUObject",
            "Engine",
            "InputCore",
            "UMG",
            "Slate",
            "SlateCore",
            "RamaSaveSystem" ,
            "AIModule",
            "AnimGraph",
            "AnimGraphRuntime",
            "GameplayTasks",
            "PhysX",
            "APEX" });

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

I know I have gone a bit overboard with the adds, but before I started to be showered with external symbol errors, this was a whole lot cleaner.

Anyways, I have no idea what I am doing wrong. I can kinda understand that the error lies with the AnimGraphNode, but I cannot for the life of me understand why it’s complaining. I have also tried changing GENERATED_UCLASS_BODY() to just GENERATED_BODY(), among a bunch of other things, but that only changes the errors visual studio throws at me.

1 Like

Hey cridia,

Here is a declaration of a UAnimGraphNode_Base that works on my end:

[build.cs]

using UnrealBuildTool;

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

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

[.h]

#pragma once

#include "AnimGraphNode_Base.h"
#include "PA_AnimGraphNode_StartCombo.generated.h"

UCLASS()
class AH487305_API UPA_AnimGraphNode_StartCombo : public UAnimGraphNode_Base
{
	GENERATED_BODY()
	
public:
    UPA_AnimGraphNode_StartCombo(const FObjectInitializer& ObjectInitializer);
    
    /*I dont know what this is so its commented out.
    UPROPERTY(EditAnywhere, Category = "Attacks")
    FPA_AnimNode_StartCombo Node;
    */    
    
    virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
    virtual FText GetTooltipText() const override;
    virtual FString GetNodeCategory() const override;
    virtual FLinearColor GetNodeTitleColor() const override;
    
protected:
    virtual FText GetControllerDescription() const;
	
};

[.cpp]

#include "AH487305.h"
#include "PA_AnimGraphNode_StartCombo.h"

UPA_AnimGraphNode_StartCombo::UPA_AnimGraphNode_StartCombo(const FObjectInitializer& ObjectInitializer ) : Super(ObjectInitializer)
{
 
}

FText UPA_AnimGraphNode_StartCombo::GetNodeTitle( ENodeTitleType::Type TitleType ) const
{
    return FText::FromString( FString( "Start Combo" ) );
}

FText UPA_AnimGraphNode_StartCombo::GetTooltipText( ) const
{
    return FText::FromString( FString( "Starts a combo" )  ); 
}

FString UPA_AnimGraphNode_StartCombo::GetNodeCategory() const 
{
    return FString( "Combo" );
}

FLinearColor UPA_AnimGraphNode_StartCombo::GetNodeTitleColor() const 
{
    return FLinearColor::Green;
}

FText UPA_AnimGraphNode_StartCombo::GetControllerDescription() const
{
    return FText::FromString( FString( "Controller Description" ) );
}

106824-487305_graphnode.png

This is just the basics. There is no functionality to this but it should get you on the right path to at least get it compiling.

Good luck.

Sorry for being late to reply. This one worked for me too. Turns out I followed the tutorials regarding the custom anim nodes a little too closely and also removed the MYGAME_API part from the AnimGraphNode. I think that was the root cause in my errors. The moment I added it, it compiled (and worked) just fine.

How are we supposed to figure out to do this sort of thing? I can’t find it documented anywhere.

Trial and error I suppose. Custom anim nodes are severely under-documented, especially now since it’s been two years and the documentation hasn’t really received much in the way of updates. Guess they are just not popular enough.