I know I have to be overlooking something simple here but I cannot use any variable or tarray declared in a header in the corresponding cpp. I created a new class to handle some computations and when I call it I get an Access Violation Writing Location error. I’ve tried to compare it to the rest of my classes and cannot figure out what I have left out. I have also cleaned and rebuilt the project. Can anyone point out what I am missing?
Here is the Header:
#pragma once
#include "GameFramework/Actor.h"
#include "EnumClass.h"
#include "BuildingListClass.generated.h"
UCLASS()
class THEBUILDING_API ABuildingListClass : public AActor
{
GENERATED_BODY()
public:
ABuildingListClass();
int16 MyLoop;
cpp:
#include "TheBuilding.h"
#include "TheBuildingGameMode.h"
#include "EnumClass.h"
#include "BuildingListClass.h"
ABuildingListClass::ABuildingListClass()
: Super()
{
}
void ABuildingListClass::TestClass()
{
MyLoop = 0;
}