FgameplayTag not building. Trying to convert BP to C++

Heya! I’m having a heck of a time trying to convert a blueprint function into C++

Here’s what i’m trying to convert:

	/** Please add a function description */
	UFUNCTION(BlueprintCallable, Category="Tags")
	void AppendGameplayTagContainers(const FGameplayTagContainer & InTag);
	

Things to note, my Project.build.cs looks like:


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

And here’s what I got directly out of UE5 that said it was the C++ preview:’



||/** Please add a function description */|
|---|---|
||UFUNCTION(BlueprintCallable, Category=Tags)|
||void ApplyTags(const FGameplayTagContainer Tags);|

Here’s my errors
XXX.gen.cpp.obj : error LNK2019: unresolved external symbol “private: void __cdecl UXXX::AppendGameplayTagContainers(struct FGameplayTagContainer const &,struct FGameplayTagContainer &)” (?AppendGameplayTagContainers@UXXX@@AEAAXAEBUFGameplayTagContainer@@AEAU2@@Z) referenced in function “public: static void __cdecl UXXX::execAppendGameplayTagContainers(class UObject *,struct FFrame &,void * const)” (?execAppendGameplayTagContainers@UXXX@@SAXPEAVUObject@@AEAUFFrame@@QEAX@Z)
C:\Users\YYY\Documents\Unreal Projects\XXX\Binaries\Win64\UnrealEditor-XXX-5950.dll : fatal error LNK1120: 1 unresolved externals

1 Like

Edit in you build file add the module GameplayTags

PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “GameplayTags” });

.h

// needs following include
#include "GameplayTagContainer.h" 

///uclass etc....

	UPROPERTY(BlueprintReadWrite, EditAnywhere)
	FGameplayTagContainer InOutTagContainer;		

	UFUNCTION(BlueprintCallable)
		void ApplyTags(const FGameplayTagContainer & PassedTags);

cpp (using an actor ATagsTest)

// needs following include
#include "BlueprintGameplayTagLibrary.h" 


void ATagsTest::ApplyTags(const FGameplayTagContainer& PassedTags)
{
	UBlueprintGameplayTagLibrary::AppendGameplayTagContainers(InOutTagContainer, PassedTags);
}

2 Likes

I could kiss you, Thank you so much 3dRaven, My day has not been a wash because of you and thank you for helping me build that mental connection.

A couple of points if someone comes to this roadblock: I’m using Rider, I had to build/compile in UE5 first for something to catch. The first time I put your code in, it failed to build. A restart and a Build with UE5 Helped fix it.

Keywords
error LNK2019: unresolved external symbol
AppendGameplayTagContainers

2 Likes