UFUNCTION(BlueprintCallable, Category = Setup)
void SetTurretReference(UTankTurret* TurretToSet);
For the above code, copied directly from the preexisting UTankBarrel version, having the UFUNCTION macro on it gives me error LNK2019, an unresolved symbol" public: void_cdec|ATank::SetTurretReference(class UTankTurret*)…"
I can change the turret pointer to a float, and adjust it accordingly in the cpp file, but it still won’t work unless I remove the UFUNCTION macro. I went over my files for a while, I did forward declaration with UTankTurret, and even had the ATank::SetTurretReference just log out that it was being called, and it compiles fine so long as the macro isn’t there.
#pragma once
#include “GameFramework/Pawn.h”
#include “Tank.generated.h”
class UTankBarrel;
class UTankTurret;
class UTankAimingComponent;
UCLASS()
class BATTLETANK_API ATank : public APawn
{
GENERATED_BODY()
public:
void AimAt(FVector HitLocation);
UFUNCTION(BlueprintCallable, Category = Setup)
void SetBarrelReference(UTankBarrel* BarrelToSet);
UFUNCTION(BlueprintCallable, Category = Setup)
void SetTurretReference(UTankTurret* TurretToSet);
CompilerResultsLog:Error: Error Tank.cpp.obj : error LNK2019: unresolved external symbol “public: void __cdecl ATank::SetTurretReference(class UTankTurret *)” (?SetTurretReference@ATank@@QEAAXPEAVUTankTurret@@@Z) referenced in function “public: void __cdecl ATank::execSetTurretReference(struct FFrame &,void * const)” (?execSetTurretReference@ATank@@QEAAXAEAU
FFrame@@QEAX@Z)