# Cannot implement "GenericTeamAgentInterface"

**URL:** <https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683>\
**Category:** UI\
**Tags:** interface, aiperception, linker-error, unreal-engine, question, CPP\
**Created:** [November 7, 2021, 1:58pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683 "2021-11-07T13:58:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Likkkez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Likkkez](https://forums.unrealengine.com/u/Likkkez)\
**Post date:** [November 7, 2021, 1:58pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/1 "2021-11-07T13:58:21Z")

</div>

I’m trying to implement the TeamID variable for my character class so that the AIPerception stuff can detect the teams following this tutorial [AI Perception in Unreal Engine 4 – How to Setup – Programming Tutorials](https://denisrizov.com/2017/05/08/ai-perception-in-unreal-engine-4-how-to-setup/)

However when I try to add the interface the compiler asks me to implement every single function and stuff out of the generated file and gives me the linking errors:

```
Determining max actions to execute in parallel (8 physical cores, 8 logical cores)
Building 4 actions with 4 processes...
  [1/4] Compile BaseCharacter.gen.cpp
  [2/4] Compile BaseCharacter.cpp
  [3/4] Link (lld) libUnrealEditor-FLife2.so
  ld.lld: error: undefined symbol: Z_Construct_UClass_UGenericTeamAgentInterface_NoRegister()
  >>> referenced by BaseCharacter.gen.cpp
  >>> /media/manjaro/AFiles/WorkCopies/FLife2-UE/FLife2/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Development/FLife2/BaseCharacter.gen.cpp.o:(Z_Construct_UClass_ABaseCharacter_Statics::InterfaceParams)
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
The terminal process "bash '-c', 'Engine/Build/BatchFiles/Linux/Build.sh FLife2Editor Linux Development /media/manjaro/AFiles/WorkCopies/FLife2-UE/FLife2/FLife2.uproject -waitmutex'" terminated with exit code: 6.

```

BaseCharacter.h :

```
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "UObject/Interface.h"
#include "GenericTeamAgentInterface.h"
#include "BaseCharacter.generated.h"

UCLASS()
class FLIFE2_API ABaseCharacter : public ACharacter, public IGenericTeamAgentInterface
{
	GENERATED_BODY()

//----------------------------------------------------------------------//
// IGenericTeamAgentInterface
//----------------------------------------------------------------------//
private:
	FGenericTeamId TeamID;
public:
	virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override;
	virtual FGenericTeamId GetGenericTeamId() const override { return TeamID; }
	virtual ETeamAttitude::Type GetTeamAttitudeTowards(const AActor& Other) const;

};

```

BaseCharacter.cpp :

```
#include "BaseCharacter.h"

ETeamAttitude::Type ABaseCharacter::GetTeamAttitudeTowards(const AActor& Other) const
{
	return ETeamAttitude::Neutral;
}

void ABaseCharacter::SetGenericTeamId(const FGenericTeamId& NewTeamID)
{
	if (TeamID != NewTeamID)
	{
		TeamID = NewTeamID;
		// @todo notify perception system that a controller changed team ID
	}
}

```

Please any help would be appreciated! I’m really at a loss and I can’t find anyone with a similar issue.

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [November 7, 2021, 2:14pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/2 "2021-11-07T14:14:46Z")

</div>

Hi, did you include “AIModule” in your project dependencies? And by the way, AFAIK you don’t need to implement “GetTeamAttitudeTowards”, I at least didn’t (and it may not be a good idea to just return neutral there for everything…)

---

<div class="post-metadata">

**Author:** ![Likkkez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Likkkez](https://forums.unrealengine.com/u/Likkkez)\
**Post date:** [November 7, 2021, 2:39pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/3 "2021-11-07T14:39:59Z")

</div>

That worked! Thanks alot!

---

<div class="post-metadata">

**Author:** ![Likkkez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Likkkez](https://forums.unrealengine.com/u/Likkkez)\
**Post date:** [November 9, 2021, 1:20am UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/4 "2021-11-09T01:20:39Z")

</div>

O ■■■■ that actually worked! Thanks alot dude!  
Yea those functions were only there because It was asking me to implement everything. Kinda a confusing error.

---

<div class="post-metadata">

**Author:** ![XimerGUD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ximergud/32/938543_2.png) [@XimerGUD](https://forums.unrealengine.com/u/XimerGUD)\
**Post date:** [March 16, 2024, 6:25pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/5 "2024-03-16T18:25:08Z")

</div>

How to do it?

---

<div class="post-metadata">

**Author:** ![zeaf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeaf/32/1108035_2.png) [@zeaf](https://forums.unrealengine.com/u/zeaf)\
**Post date:** [March 16, 2024, 6:29pm UTC](https://forums.unrealengine.com/t/cannot-implement-genericteamagentinterface/490683/6 "2024-03-16T18:29:27Z")

</div>

In your game’s Build.cs file, you need to add `AIModule` in your `PublicDependencyModuleNames`
