Can't create / compile BTTaskNode C++ class in 3 versions of UE4

This applicable to 4.14, 4.13.2, 4.12.5. Using VS Community 2015

Everytime I create a C++ class based on BTTaskNode in Unreal, I get the following error screen:

In the output log I get the follwing:

CompilerResultsLog:Error: Error MyBTTaskNode.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl IGameplayTaskOwnerInterface::OnGameplayTaskActivated(class UGameplayTask &)” (?OnGameplayTaskActivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z) CompilerResultsLog:Error: Error CoffeeShop.generated.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl IGameplayTaskOwnerInterface::OnGameplayTaskActivated(class UGameplayTask &)” (?OnGameplayTaskActivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z) CompilerResultsLog:Error: Error D:\Development\Unreal Engine\CoffeeShop\Binaries\Win64\UE4Editor-CoffeeShop-7616.dll : fatal error LNK1120: 1 unresolved externals

What is this from?

1 Like

After 12 hours of pulling my hair out. I realized I didn’t add the dependencies for the classes I was using in my build.cs file. Idiot me.

You can disregard this.:slight_smile:

1 Like

What dependencies did you add? I have the same problem too, thanks.

I copied dependencies from a tutorial project that added 2 or 3 dependencies, I’m not sure which one exactly fixed the error, but here is the line of code I used:

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

Its probably AIModule and GameplayTasks

Thank you so much, been stuck on this one for a bit