[SOLVED]LNK2019/2001 errors with Gameplay Tags used across custom modules

For LNK2019

Add GameplayTags to the PublicDependencyModuleNames inModules.Build.cs
Modules.Build.cs

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class Modules : ModuleRules
{
	public Modules(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[]
		{
			"Core",
			"CoreUObject",
			"Engine",
			"InputCore",
			"EnhancedInput",
			"GameplayTags",
			"TagsModule"
		});

		PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}

For LNK2001

Add <ModuleName>_API (in my case TagsModule_API) before UE_DECLARE_GAMEPLAY_TAG_EXTERN and UE_DEFINE_GAMEPLAY_TAG macros
Tags.h

#pragma once

#include "CoreMinimal.h"
#include "NativeGameplayTags.h"

TAGSMODULE_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Test);

Tags.cpp

#include "Tags.h"

TAGSMODULE_API UE_DEFINE_GAMEPLAY_TAG(TAG_Test,"Test");
1 Like