Complie error

I am getting a strange compile error after following class 55.
Here is the log of the failed compilation.

Parsing headers for BullCowGameEditor
  Running UnrealHeaderTool "D:\GameDownload\Unrealmaterial\BullCowGame-starter-kit\BullCowGame.uproject" "D:\GameDownload\Unrealmaterial\BullCowGame-starter-kit\Intermediate\Build\Win64\BullCowGameEditor\Development\BullCowGameEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\wxylghl\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
Reflection code generated for BullCowGameEditor in 16.2451925 seconds
Building BullCowGameEditor...
Using Visual Studio 2019 14.29.30038 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[Upgrade]
[Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
[Upgrade]     bLegacyPublicIncludePaths = false                 => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
[Upgrade]     ShadowVariableWarningLevel = WarningLevel.Error   => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
[Upgrade]     PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs   => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
[Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in BullCowGameEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
[Upgrade]
Building 5 actions with 8 processes...
  [1/5] BullCowCartridge.cpp
   D:\GameDownload\Unrealmaterial\BullCowGame-starter-kit\Source\BullCowGame\BullCowCartridge.cpp(33) : error C4552: ??-??: δʹ?ñ???ʽ????R  [2/5] BullCowCartridge.gen.cpp

Could you show line 33 of BullCowCartridge.cpp?

// Fill out your copyright notice in the Description page of Project Settings.
#include "BullCowCartridge.h"

void UBullCowCartridge::BeginPlay() // When the game starts
{
    Super::BeginPlay();
    // int32 NumOfLetter =4;
    
    
    //Welcome the player
    PrintLine(TEXT("Welcome to Bull Cows!"));
    PrintLine(TEXT("enter a 4 letter word and press enter to see if you got it right..."));
    
    
    InitGame();
    

    //prompt player for a guess
}

void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
    ClearScreen(); 
    PrintLine(Input);
    
    //Check PlayerGuess
    
    
    if(Input == HiddenWord){
        PrintLine(TEXT("You are right."));
    }else if(Input == TEXT("") ){
        PrintLine(TEXT("I am sad about the fact that you don't even bother to try. :( "));
        Lives-1;//Remove Life
    }else{
        PrintLine(TEXT("Try again!"));
    }
    //Check If Isograms
    //Prompt to guess again
    //Check If right number of Characters
    //Prompt to guess again
    //Remove Life

    //Check if life >0
    //Yes GuessAgain
    //Show Lives left
    //If No Show GameOver and HiddenWord
    //Prompt to play again, press enter to play again?
    //Check User Input
    //playagain or quit
}

//Initialize the Game
void UBullCowCartridge::InitGame(){
    
    HiddenWord = TEXT("cake");//Set HiddenWord
    Lives = 4;//Set Lives
}

The line 33 is:

Lives-1;//Remove Life

That’s not doing anything as that doesn’t modify Lives.

Lives = Lives - 1;

Or more concisely

Lives--;
1 Like

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

Privacy & Terms