Tutorial c++ code ended up with link error

Hi,
I’m following the “3rd Person Power-up Game with C++” video, and I’m at the 3rd video writing the Pickup class,
i’m on 4.7.6, well i followed all the transion guide that i can find to correct the code incompatibility, but eventually I still get this link error :

unresolved external symbol “public: virtual void __cdecl APickUp::OnPickedup_Implementation(void)” (?OnPickedup_Implementation@APickUp@@UEAAXXZ),

and also a warning says “Function PickUp::OnPickedup needs native implementation by virtual void OnPickedup_Implementation() due to its properties” exists.

originally i didn’t declare "void OnPickedup_Implementaion(); " manually, in that case, one compile warning says that it would be generated by UHT but in next version it should be declared manually, and then another error followed saying my “OnPickedup_Implementaion” is not declared which prevents me from advancing, so i searched and followed another thread which added the declaration manually and then ended up with the link error. really appreciate if someone can help me take a look:

Here’s the my code:
PickUp.h:


#pragma once

#include "GameFramework/Actor.h"
#include "PickUp.generated.h"

UCLASS()
class POWERUPDEMO_API APickUp : public AActor
{
	GENERATED_BODY()
	
public:	
	APickUp();

	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	//This one is added manually by Austin
	APickUp(const FObjectInitializer &ObjectInitializer);

	//Customized properties by Austin
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Pickup)
		bool bIsActive;

	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
		USphereComponent* BaseCollisionComponent;

	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
		UStaticMeshComponent* PickupMesh;

	UFUNCTION(BlueprintNativeEvent)
	void OnPickedup();
	virtual void OnPickedup_Implementaion();

};

PickUp.cpp:

#include "PowerUpDemo.h"

# include "PickUp.h"




APickUp::APickUp()
{
	PrimaryActorTick.bCanEverTick = true;

}

APickUp::APickUp(const FObjectInitializer &PCIP)
	:Super(PCIP)
{
	bIsActive = true;
	BaseCollisionComponent = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("AustinBaseSphereComponent"));
	RootComponent = BaseCollisionComponent;
	PickupMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("AustinPickupMesh"));
	PickupMesh->SetSimulatePhysics(true);
	PickupMesh->AttachTo(RootComponent);
}

void APickUp::OnPickedup_Implementaion()
{
	
}

void APickUp::BeginPlay()
{
	Super::BeginPlay();
	
}

void APickUp::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );

}


I understood almost nothing, but did you actually implement the function in cpp file?

yes, the thing i did over and over is checking if the implementation matches the declaration. i even added __cdecl according to the error and still can’t get pass.

i think UFUNCTION(BlueprintNativeEvent) actually did declare something, but i just don’t know how can i implement it to match its form.

There’s a spelling error in your function declaration:

Instead of

OnPickedup_Implementaion

it should be

OnPickedup_Implementation

I think Blueprints specifically looks for the function “_Implementation”

staticvoidlol thanks for checking it for me, i will be more careful in the future

and also change GENERATED_BODY() to GENERATED_UCLASS_BODY()

and instead of TSubobjectPtr or TSubobjectPtr in header file must use
class USphereComponent* BaseCollisionComponent;
and

class UStaticMeshComponent* PickupMesh;

and delete
void APickUp::BeginPlay()
{
Super::BeginPlay();

 }
 
 void APickUp::Tick( float DeltaTime )
 {
     Super::Tick( DeltaTime );
 
 }

if you do not need them.

tested in UE4.8