How do I cast a Controller to an AiController?

Every time I try to cast a Controller to an AiController it will fail at link time



#include "AIController.h"
...
AAIController* Ac = Cast<AAIController>(ServerCharacter->GetController());


1>     Creating library E:\unreal\Arena\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Arena-6205.lib and object E:\unreal\Arena\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Arena-6205.exp
1>ArenaCharacterProxy.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class UClass * __cdecl AAIController::StaticClass(void)" (__imp_?StaticClass@AAIController@@SAPEAVUClass@@XZ) referenced in function "class AAIController * __cdecl Cast<class AAIController,class AController>(class AController *)" (??$Cast@VAAIController@@VAController@@@@YAPEAVAAIController@@PEAVAController@@@Z)
1>E:\unreal\Arena\Binaries\Win64\UE4Editor-Arena-6205.dll : fatal error LNK1120: 1 unresolved externals

Finally solved it

I needed to add the AIModule


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