Could I get some help resolving "syntax error : missing ';' before '*'"?

The compiler is driving me nuts…I am trying to fix this error for hours now

#pragma once

#include "GameFramework/PlayerState.h"
#include "KaoriPlayerState.generated.h"

/**
 * 
 */
UCLASS()
class AKaoriPlayerState : public APlayerState
{
	GENERATED_UCLASS_BODY()
	
protected:

	AKaoriTeam *Team;

public:	

	UFUNCTION()
	void SetTeam(AKaoriTeam *NewTeam);

	UFUNCTION()
	AKaoriTeam* GetTeam();
};

1> \KaoriPlayerState.h(18): error C2143: syntax error : missing ‘;’ before ‘
1> \KaoriPlayerState.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1> \KaoriPlayerState.h(23): error C2061: syntax error : identifier ‘AKaoriTeam’
1> \KaoriPlayerState.h(26): error C2143: syntax error : missing ‘;’ before '

Also if I include the header for the AKaoriTeam class the buildtool crashes
19>Error : Failed to generate code for KaoriEditor - error code: -1073741571

Instead of:

AKaoriTeam *Team;

use:

class AKaoriTeam *Team;

and instead of:

UFUNCTION()
void SetTeam(AKaoriTeam *NewTeam);

use:

UFUNCTION()
void SetTeam(class AKaoriTeam *NewTeam);

Same for your last function too.

1 Like

Also Epic C++ Coding StandardBlueprint Debugging in Unreal Engine | Unreal Engine Documentation :slight_smile:

Thank you that worked. I still have a long way to go with c++ :frowning:

Omg, thank you. I had the same problem when I was making Interface for RPG-Turn-Based combat

It took me like a whole day of suffering… and you fixed it with just a single word “CLASS” :smiley: