Gameplay Debugger - Create Templated Category

Hello everyone,

I’m trying to make a generic templated category for the gameplay debugger. I’m currently following this tutorial:

But I’m currently having compile error with it which is:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FGameplayDebuggerCategory::FGameplayDebuggerCategory(void)" (__imp_??0FGameplayDebuggerCategory@@QEAA@XZ) referenced in function "public: static class TSharedRef<class FGameplayDebuggerCategory,0> __cdecl FGameplayDebuggerCategoryT<class USoldierStateComponent>::MakeInstance(void)" (?MakeInstance@?$FGameplayDebuggerCategoryT@VUSoldierStateComponent@@@@SA?AV?$TSharedRef@VFGameplayDebuggerCategory@@$0A@@@XZ)
2>dbsbuild : error : aborting build on error (1120)

But I don’t really understood what’s happening here. I put every function def in the .h file to make sure to avoid unresolved symbol but I still get this one no matter what.

The specialized version of the template is declared here:

UMyGameInstance::UMyGameInstance(const FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer)
    FGameplayDebuggerCategoryT<USoldierStateComponent>::Register(TEXT("Soldier State"), 6);

And it seems the problems is coming from either this line in Register function:

auto creationDelegate = IGameplayDebugger::FOnGetCategory::CreateStatic(&FGameplayDebuggerCategoryT<T>::MakeInstance);

or this:

template<typename T>
inline TSharedRef<FGameplayDebuggerCategory> FGameplayDebuggerCategoryT<T>::MakeInstance()
    return MakeShareable(new FGameplayDebuggerCategoryT<T>());

But I’m not sure to understand why. Does anyone tryied to reuse to implementation from this tutorial?

Thanks a lot

The FGameplayDebuggerCategory struct belongs to the “GameplayDebugger” module. For your project to be able to use it, you’ll need to add “GameplayDebugger” to the modules array in your project’s Build.cs file.

God I hate myself and thank you so much, didn’t knew it was on a separate module…