I’m new to the Unreal 5 engine C++ API.
I’m receiving an unusual syntax error where one minute I was able to compile and the next minute it returns Live Coding errors.
It’s indicating I need to terminate before the pointer. Any insight would be grateful. Thank you.
UPROPERTY(EditAnywhere)
UCameraComponent* Camera;
Building PawnEditor...
Using Visual Studio 2019 14.29.30146 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[Adaptive Build] Excluded from Pawn unity file: MyPawn.cpp, Pawn.cpp, PawnGameModeBase.cpp
Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
Executing up to 4 processes, one per physical core
Building 2 actions with 2 processes...
[1/2] Compile MyPawn.gen.cpp
H:\Unreal Projects\Pawn\Source\Pawn\MyPawn.h(22): error C2143: syntax error: missing ';' before '*'
H:\Unreal Projects\Pawn\Source\Pawn\MyPawn.h(22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
H:\Unreal Projects\Pawn\Source\Pawn\MyPawn.h(22): error C2238: unexpected token(s) preceding ';'
H:\Unreal Projects\Pawn\Intermediate\Build\Win64\UnrealEditor\Inc\Pawn\MyPawn.gen.cpp(73): error C2039: 'Camera': is not a member of 'AMyPawn'
H:\Unreal Projects\Pawn\Source\Pawn\MyPawn.h(10): note: see declaration of 'AMyPawn'
H:\Unreal Projects\Pawn\Intermediate\Build\Win64\UnrealEditor\Inc\Pawn\MyPawn.gen.cpp(73): error C2618: illegal member designator in offsetof
H:\Unreal Projects\Pawn\Intermediate\Build\Win64\UnrealEditor\Inc\Pawn\MyPawn.gen.cpp(73): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
MyPawn.h
UCLASS()
class PAWN_API AMyPawn : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
AMyPawn();
UPROPERTY(EditAnywhere)
UStaticMeshComponent* CubeMesh;
UPROPERTY(EditAnywhere)
UCameraComponent* Camera;