Undefined symbols for architecture x86_64:
“vtable for ATest2Character”, referenced from:
ATest2Character::ATest2Character() in Test2Character.cpp.o
ATest2Character::ATest2Character(FVTableHelper&) in Test2Character.gen.cpp.o
ATest2Character::ATest2Character(FVTableHelper&) in Test2Character.gen.cpp.o
ATest2Character::__VTableCtorCaller(FVTableHelper&) in Test2Character.gen.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Users/Shared/Epic Games/UE_4.22/Engine/Build/BatchFiles/Mac/XcodeBuild.sh failed with exit code 5
I started following a tutorial and the compiler started not liking code that was already put in and it worked before. This is code the unreal engine had already put in (thirdperson character template) and idk what to do, ive been stuck on this for about 3 days now. Note, i did add health functions because im trying to add health and a stamina bar, maybe im going about it the wrong way and it doesnt like it. Im not sure. Ill post the code here:
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include “Core.h”
#include “GameFramework/Character.h”
#include “Test2Character.generated.h”
UCLASS(config=Game)
class ATest2Character : public ACharacter
{
GENERATED_BODY()
/** Camera boom positioning the camera behind the character */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class USpringArmComponent* CameraBoom;
/** Follow camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* FollowCamera;
public:
ATest2Character();
virtual void Tick(float DeltaTime) override;
/** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
float BaseTurnRate;
/** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
float BaseLookUpRate;
private:
//Character Attributes
UPROPERTY(EditAnywhere,Category=Attributes)
float Health = 1.0f;
UPROPERTY(EditAnywhere,Category=Attributes)
float Stamina = 1.0f;
UPROPERTY(EditAnywhere,Category=Attributes)
FString PlayerName = “”;
protected:
/** Resets HMD orientation in VR. */
void OnResetVR();
/** Called for forwards/backward input */
void MoveForward(float Value);
/** Called for side to side input */
void MoveRight(float Value);
/**
* Called via input to turn at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
*/
void TurnAtRate(float Rate);
/**
* Called via input to turn look up/down at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
*/
void LookUpAtRate(float Rate);
/** Handler for when a touch input begins. */
void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
/** Handler for when a touch input stops. */
void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
public:
//get health and stamina functions
UFUNCTION(Blueprintpure, category = Attributes)
float GetHealth();
UFUNCTION(Blueprintpure, category = Attributes)
float GetStamina();
UFUNCTION(Blueprintpure, category = Attributes)
float GetCurrentHealth();
UFUNCTION(Blueprintpure, category = Attributes)
float GetCurrentStamina();
UFUNCTION(Blueprintpure, category = Attributes)
FString GetPlayerName();
protected:
// APawn interface
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
// End of APawn interface
public:
/** Returns CameraBoom subobject /
FORCEINLINE class USpringArmComponent GetCameraBoom() const { return CameraBoom; }
/* Returns FollowCamera subobject */
FORCEINLINE class UCameraComponent GetFollowCamera() const { return FollowCamera; }
};
never touched any Virtutal functions nor any VTables its talking about. I tried to figure this out on my own but its getting out of hand. Please help!