Hiya, I’m getting the below linker error when I try to use FGameplayTagContainer. I’ve created a new project in 4.21, created two gameplay tags in project settings > GameplayTags and created a new .cpp Actor class. This is my header file and I haven’t made any changes to the .cpp file. Exactly the same thing happens in 4.20 with a fresh project and in my existing 4.20 project. Can anyone else reproduce this or have I just messed up my UE4 installation somehow?:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "GameplayTagContainer.h"
#include "MyActor.generated.h"
UCLASS()
class TAGTEST_API AMyActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMyActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY()
FGameplayTagContainer MyContainer;
};
MyActor.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: __cdecl FGameplayTagContainer::FGameplayTagContainer(void)” (_imp??0FGameplayTagContainer@@QEAA@XZ) referenced in function “public: __cdecl AMyActor::AMyActor(void)” (??0AMyActor@@QEAA@XZ)
MyActor.gen.cpp.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __cdecl FGameplayTagContainer::FGameplayTagContainer(void)” (_imp??0FGameplayTagContainer@@QEAA@XZ)
MyActor.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: __cdecl FGameplayTagContainer::~FGameplayTagContainer(void)” (_imp??1FGameplayTagContainer@@QEAA@XZ) referenced in function “public: virtual __cdecl AMyActor::~AMyActor(void)” (??1AMyActor@@UEAA@XZ)
MyActor.gen.cpp.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __cdecl FGameplayTagContainer::~FGameplayTagContainer(void)” (_imp??1FGameplayTagContainer@@QEAA@XZ)
MyActor.gen.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) class UScriptStruct * __cdecl Z_Construct_UScriptStruct_FGameplayTagContainer(void)” (_imp?Z_Construct_UScriptStruct_FGameplayTagContainer@@YAPEAVUScriptStruct@@anonymous_user_9674a66c) referenced in function “void __cdecl `dynamic initializer for ‘public: static struct UE4CodeGen_Private::FStructPropertyParams const Z_Construct_UClass_AMyActor_Statics::NewProp_MyContainer’’(void)” (??__E?NewProp_MyContainer@Z_Construct_UClass_AMyActor_Statics@@2UFStructPropertyParams@UE4CodeGen_Private@@anonymous_user_31e84eb0@@YAXXZ)
C:\Users\riche\Documents\TagTest\Binaries\Win64\UE4Editor-TagTest-1661.dll : fatal error LNK1120: 3 unresolved externals
UnrealBuildTool : error : UBT ERROR: Failed to produce item: C:\Users\riche\Documents\TagTest\Binaries\Win64\UE4Editor-TagTest-1661.dll
(see …/Programs/UnrealBuildTool/Log.txt for full exception trace)