Losing my mind due to "unresolved external symbol"

Hello, I’m trying to create a “teams” or “factions” section that shows up in project settings so I can easily customize team relations. I keep getting this error:

Data.gen.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class UEnum * __cdecl Z_Construct_UEnum_AIModule_ETeamAttitude(void)" (__imp_?Z_Construct_UEnum_AIModule_ETeamAttitude@@YAPEAVUEnum@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FBytePropertyParams const Z_Construct_UScriptStruct_FTeamSettings_Statics::NewProp_Attitude_Inner''(void)" (??__E?NewProp_Attitude_Inner@Z_Construct_UScriptStruct_FTeamSettings_Statics@@2UFBytePropertyParams@UE4CodeGen_Private@@B@@YAXXZ)

But my code looks fine as far as I can tell:

#pragma once

#include "GenericTeamAgentInterface.h"
#include "Data.generated.h"

struct FTeamSettings

	UPROPERTY(BlueprintReadWrite, EditAnywhere)
	TArray<TEnumAsByte<ETeamAttitude::Type>> Attitude;

	FTeamSettings() {};

	FTeamSettings(std::initializer_list<TEnumAsByte<ETeamAttitude::Type>> Attitudes) : Attitude(std::move(Attitudes)) {};

I’ve included GenericTeamAgentInterface.h which is where ETeamAttitude comes from.

Does anyone know what I’m doing wrong?

1 Like

Likely you have not included the appropriate module (AIModule?) in your build.cs file.


Ah, thank you. That did it.