Need help with C1083 on Bull Cow Game

Hi all. I have some problem with C1083, i using UE4.26 and VS 2019. In block “TArray Of Hidden Words” need create new file “HiddenWordList.h” in directory “\BullCowGame-starter-kit\Source\BullCowGame” but compile say me C1083. In VS 2019 have no errors.

Sorry for my bad eng, i glad what u understand me)

This error is because the compiler don’t find the file you should post your code too.

All like in video
File “HiddenWordsList.h”

#include "CoreMinimal.h"

const TArray<FString> Words = 
{ 
	TEXT("cakes"),
	TEXT("water"),
	TEXT("plums"),
	TEXT("kings"),
	TEXT("knife")
};

And “BullCowCartridge.cpp”:

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



void UBullCowCartridge::BeginPlay() // When the game starts
{
	Super::BeginPlay();

	SetupGame();
	
	PrintLine(FString::Printf(TEXT("The HiddenWord is: %s. It is %i character long."), *HiddenWord, HiddenWord.Len())); //Debug Line

}

void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
	if (bGameOver)
	{
		ClearScreen();
		SetupGame();
	}
	else
	{
		ProcessGuess(Input);
		
	}

}

void UBullCowCartridge::SetupGame() 
{
	HiddenWord = TEXT("Cake"); // Set the HiddenWord
	Lives = HiddenWord.Len();
	bGameOver = false;

	PrintLine(TEXT("Hello and welcome to my terminal game \nabout bulls and cows!"));
	PrintLine(TEXT("For start, pls input Enter"));
	PrintLine(TEXT("Guess the %i letter word!"), HiddenWord.Len());
	PrintLine(TEXT("You have %i Lives"), Lives);

}

void UBullCowCartridge::EndGame()
{
	bGameOver = true;
	PrintLine(TEXT("Press Enter to play again"));
}

void UBullCowCartridge::ProcessGuess(FString Guess)
{
	if (Guess == HiddenWord)
	{
		PrintLine(TEXT("You win!"));
		EndGame();
	}

	if (Guess.Len() != HiddenWord.Len())
	{

		PrintLine(TEXT("HiddenWord have only %i letter"), HiddenWord.Len());
		Lives = --Lives;
		PrintLine(TEXT("Lives = %i"), Lives);
	}

	if (!IsIsogram(Guess))
	{
		PrintLine(TEXT("No repeting characters"));
	}

	--Lives;
	PrintLine(TEXT("Lost your live"));

	if (Lives <= 0)
	{
		PrintLine(TEXT("You Lives is over. \nPlay Enter for play again"));
	}
	else {
		PrintLine(TEXT("You lose!"));
		EndGame();
	}
}

bool UBullCowCartridge::IsIsogram(FString Word) const
{
	int32 Index = 0;

	for ( int32 Index = 0; Index < Word.Len(); Index++)
	{
		for (int32 Comparison = Index + 1; Comparison < Word.Len(); Comparison++)
		{
			if (Word[Index] == Word[Comparison])
			{
				return false;
			}
		}
	}

	return true;
	
	return true;
}

Did you wrote the HiddenWordList with a S at word or not?

No. all normal, it’s just my bad
image

I mean all normal with naming

Have you verified if the HiddenWord file is in the good folder?

Do you compile it in UE or in visual Studio

All files in “\BullCowGame-starter-kit\Source\BullCowGame” and compile in UE

Maybe @Tuomo_T could help you better than me! You can also try to compile in Visual Studio and post the copy of the error message


errors after Shift Ctrl B

Could you show the Source/BullCowGame directory in File Explorer please?

yes, please

Compare the spelling of the file you have there and the name of the file you’re trying to include.

thank you very much!!! i dont know why in VS correct name, if in folder uncorrect

In Visual Studio, the “folders” are just filters to organize your code. Typically you’d want the filters to match the folders you have to keep things consistent but because filters are not folders this allows names to be different, along with other things like hierarchy and structure.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms