Hey there!
I’ve just update a project from Unreal 5.4.4 to 5.5.1. When I’ve compiled it I’ve got the following error:
Error C2374 ‘NextFallingBlockSpawnLocation’: new definition; multiple initialisation C:\source\Tetris\Public\GameModeBase.h 14
Error C2374 ‘NextBlockSampleSpawnLocation’: new definition; multiple initialisation C:\source\Tetris\Public\GameModeBase.h 15
I have two header files with these declarations.
In TTetrisGameModeBase.h
:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "TUtils.h"
#include "GameFramework/GameModeBase.h"
#include "TTetrisGameModeBase.generated.h"
class ATFallingBlockActor;
class ATCheckLinesActor;
const FVector PuzzleToSolveSpawnLocation = FVector(0.0f, -500.0f, 850.0f);
const FVector NextFallingBlockSpawnLocation = FVector(0.0f, 25.0f, 1000.0f);
const FVector NextBlockSampleSpawnLocation = FVector(0.0f, -850.0f, 850.0f);
/**
*
*/
UCLASS()
class TETRIS_API ATTetrisGameModeBase : public AGameModeBase
And in TProgrammingModeBase.h
:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "TProgrammingModeBase.generated.h"
enum class EInstruction : uint8;
class ATCheckLinesActor;
class ATFallingBlockActor;
enum class EBlockType : uint8;
const FVector NextFallingBlockSpawnLocation = FVector(0.0f, 25.0f, 1000.0f);
const FVector NextBlockSampleSpawnLocation = FVector(0.0f, -850.0f, 850.0f);
const FVector CreatedInstructionSpawnLocation = FVector(0.0f, -600.0f, 150.0f);
/**
*
*/
UCLASS()
class TETRIS_API ATProgrammingModeBase : public AGameModeBase
I don’t know why I’m getting these errors because these header files don’t reference each other.
Any idea?
Thanks.