Search code examples
c++game-developmentunreal-engine5

“incomplete type is not allowed” & “member function declared with ‘override’ does not override a base class member” in blank UE 5.3 project


started blank project (named SampleShooter) and created a c++ character but it gives me this error:

Severity    Code    Description Project File    Line    Suppression State   Details

Error (active)  E0070   incomplete type is not allowed  SampleShooter   C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Containers\StringView.h    408     

Error (active)  E0070   incomplete type is not allowed  SampleShooter   C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Containers\StringView.h    415     

Error (active)  E1455   member function declared with ‘override’ does not override a base class member  SampleShooter   C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Serialization\ArchiveProxy.h   157     

Error (active)  E1455   member function declared with ‘override’ does not override a base class member  SampleShooter   C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Serialization\ArchiveProxy.h   167

the header file named BaseCharacter.h is this:

#pragma once

include “CoreMinimal.h”
include “GameFramework/Character.h”
include “BaseCharacter.generated.h”

UCLASS()
class SAMPLESHOOTER_API ABaseCharacter : public ACharacter
{
GENERATED_BODY()

public:
// Sets default values for this character’s properties
ABaseCharacter();

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

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

// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

};

the cpp file named BaseCharacter.cpp is this:

include “BaseCharacter.h”

// Sets default values
ABaseCharacter::ABaseCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void ABaseCharacter::BeginPlay()
{
Super::BeginPlay();

}

// Called every frame
void ABaseCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);

}

// Called to bind functionality to input
void ABaseCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);

}

i dont see any include mistakes and the code should work. sounds like he had the same problem:

https://forums.unrealengine.com/t/incomplete-type-is-not-allowed/114700

https://forums.unrealengine.com/t/incomplete-type-is-not-allowed/431166

https://forums.unrealengine.com/t/unable-to-compile-blank-project/1214010

…is there any other solution besides ignoring it by using build only ?


Solution

  • I got the same error in Visual Studio, then I decided to switch to Rider and it told that build is failing because Live Coding console is launched (though I didn't have UE opened). Then I restarted my computer to kill live console and managed to build.

    I guess it's just VS not being able to give correct error message, when it's raised by UnrealBuildTool, try switching tabs to see the actual log with UBT error.