Download

Code that compiled yesterday mysteriously does not compile today.

I loaded up my project that I started yesterday and started making modifications to the code. After these modifications, the code no longer compiled so I undid all of the changes. The code is exactly how it was yesterday, and yet fails to compile.

Here is the code in my .h file:


// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Territory.generated.h"

UENUM()
enum class EContinent : uint8
{
    NorthAmerica,
    SouthAmerica,
    Africa,
    Asia,
    Europe,
    Australia
};

UCLASS()
class RISKCLONE_API ATerritory : public AActor
{
    GENERATED_BODY()

public:    
    // Sets default values for this actor's properties
    ATerritory();

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=StaticAttributes)
    FString TerritoryName = TEXT("");
    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=StaticAttributes) EContinent Continent;
    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=StaticAttributes)
    TArray<ATerritory*> NeighboringTerritories;
    UPROPERTY(BlueprintReadWrite, Category=DynamicAttributes)
    int32 CurrentArmyCount;

protected:
    // Called when the game starts or when spawned
    virtual void BeginPlay() override;

public:    
    // Called every frame
    virtual void Tick(float DeltaTime) override;



};

Here are the errors it is throwing on compile:


Severity    Code    Description    Project    File    Line    Suppression State
Error    C4430    missing type specifier - int assumed. Note: C++ does not support default-int    RiskClone    C:\Users\PEECEE\Documents\Unreal Projects\RiskClone\Source\RiskClone\Public\Territory.h    32    
Error    C2059    syntax error: 'function-style cast'    RiskClone    C:\Users\PEECEE\Documents\Unreal Projects\RiskClone\Source\RiskClone\Public\Territory.h    10    
Error    C2143    syntax error: missing ';' before '{'    RiskClone    C:\Users\PEECEE\Documents\Unreal Projects\RiskClone\Source\RiskClone\Public\Territory.h    11    
Error    C2447    '{': missing function header (old-style formal list?)    RiskClone    C:\Users\PEECEE\Documents\Unreal Projects\RiskClone\Source\RiskClone\Public\Territory.h    11    
Error    C3646    'Continent': unknown override specifier    RiskClone    C:\Users\PEECEE\Documents\Unreal Projects\RiskClone\Source\RiskClone\Public\Territory.h    32

Here is the enum working just fine from when I compiled yesterday:

image_152520.jpg

EDIT: I fat fingered the keys and inserted a ‘3’ at the very beginning of my .cpp file, causing everything to come crashing down.



3// Fill out your copyright notice in the Description page of Project Settings.