Compiler ERROR tell me how to fix it building escape new plz help

ERROR

C:/Users/mother hacker/Documents/Unreal Projects/escpe1/Source/escpe1/worldposition.h(1) : Error: Missing 'class' in Class declaration

code escpe1.h

#pragma once

#include "CoreMinimal.h"

#include "Components/ActorComponent.h"

#include "Worldposition.generated.h"

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) );

Class ESCAPE_API UWorldposition : public UActorComponent

{

    GENERATED_BODY()

public: 

    // Sets default values for this component's properties

    UWorldposition();

protected:

    // Called when the game starts

    virtual void BeginPlay() override;

public: 

    // Called every frame

    virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

        

};

Remove the semicolon here

dan it didnt work why

Can you compile?

no i get an error the error i typed above

That’s after removing the semicolon?

yeap

So you didn’t compile right? Just save your file and then compile.

i did that

Could you provide the output log?

this is it

sers\mother hacker\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
CompilerResultsLog: Error: C:/Users/mother hacker/Documents/Unreal Projects/escpe1/Source/escpe1/worldposition.h(1) : Error: Missing 'class' in Class declaration
LogMainFrame: MainFrame: Module compiling took 10.321 seconds
Warning: HotReload failed, recompile failed

Did you modify the code generated by UE? That could be why. I guess you could just delete and create a new class, cause you haven’t added any code yet, have you?

Try writing this instead:

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class ESCAPE_API UWorldposition : public UActorComponent

Changes:

  • Class has been made lower-case: class
  • UCLASS( ... ) sits directly above the class definition.
  • EDIT: The ; was taken away from the end of UCLASS()

Nice find did not spot that uppercase C. but the semicolon should be removed still.

That’s true. I forgot!

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

Privacy & Terms