Word List is undefined

I know that this is probably a really easy problem to fix, but I can’t find anything online to answer my question. My issue is is that every time I try to access the word list from my header file, I get this error: identifier “WordList” is undefined

I have no idea if there is a problem with my header file, or my .cpp file. But if someone could just help me out, because I don’t see how I will be able to continue if I don’t get this fixed.

My .h file:
“HiddenWordList.h”

#pragma once

#include "CoreMinimal.h"

const TArray<FString> WordList = 
{ . . . }

My .cpp file

#include "BullCowCartridge.h"
#include "HiddenWordList.h"

. . . 

PrintLine(TEXT("The number of possible words is %i."), WordList.Num()); 

Here’s a screenshot to provide further information:

Any luck with this?

Does your code compile?

Well from what I can remember, whenever I create a header file and then try to build, it returns an error. The error is something along the lines of “cannot include this header file”; I can’t remember what it exactly the error stated.

Where did you save HiddenWordList.h?

Privacy & Terms