[BUG] Failed TO ADD CLASS TO PARENT CLASS 4.7.3

here is the problem , but it seems we can’t get the right help yet, I know and appreciate how most of the staff suffer to help and guide us.

again, I would confirm that when I add a class to a parent class , an error popup saying “Failed to add class, name already exist”
however when I go back to VS, I Found that it’s already added the class but fail to compile, even after removing the added files it cannot compile my project anymore.
I did that using UE4 version 4.7.3 which I installed using EPIC Launcher , Not GitHub version “source code” .
here is some screenshots:-

I know how all the staff are busy, but may someone could confirm this issue or did I miss something?

Thanks a lot.

No, I Did implement it
and please kindly, remove this answer and paste it in comment section to help staff find out UnAnswered questions

this is PickUp Class header file

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

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

UCLASS()
class TUTORIALCODE_API APickUp : public AActor
{
	GENERATED_UCLASS_BODY()

public:
	// True when the pickup is able to be picked up, false if something deactivates the pickup //
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pickup")
		bool bIsActive;

	// Simple collision primitive to use as the root component //
	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = "Pickup")
	class USphereComponent* BaseCollisionComponent;

	// StaticMeshComponent to represent the pickup in the level //
	UPROPERTY(VisibleDefaultsonly, BlueprintReadOnly, Category = "Pickup")
	class UStaticMeshComponent* PickUpMesh;

	UFUNCTION(BlueprintNativeEvent)
		void OnPickedUp();



public:
	// Sets default values for this actor's properties
	APickUp();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

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



};

This is the Class Cpp files

// Fill out your copyright notice in the Description page of Project Settings.

#include "TutorialCode.h"
#include "PickUp.h"


// Sets default values
APickUp::APickUp(const class FObjectInitializer& PCIP)

{
	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = false;

	//The PickUp is Valid when it is created
	bIsActive = true;

	// Create the root sphereComponent to handle the puckup's collision //
	BaseCollisionComponent = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("BaseShpereComponent"));

	// Set the SphereComponent as the root Component
	RootComponent = BaseCollisionComponent;

	//Create the static mesh component
	PickUpMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("PickUpMesh"));

	//Turn physics on for the static mesh
	PickUpMesh->SetSimulatePhysics(true);

	// Attach the staticMeshComponent to the root component
	PickUpMesh->AttachTo(RootComponent);



}

void APickUp::OnPickedUp_Implementation()
{
	//there is no default behavior for a pickup when it is picked up
}



// Called when the game starts or when spawned
void APickUp::BeginPlay()
{
	Super::BeginPlay();

}

// Called every frame
void APickUp::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

I was right, you have default constructor declaration but no implementation :slight_smile:
“APickUp()”
Just make sure your declaration and implementation are the same
Hope it helps!
Believe me or not, I didn’t mean to be rude :slight_smile:

Any help yet?

Any Help?!

Hey Omar Victoria-

To fix the project not compiling you should be able to delete the .h and .cpp file from your source folder for the project and then right click the .uproject and choose “Generate Project Files” which will correspondingly remove them from your project solution. Also, updating to the latest engine version should help. Let just know if you still have this problem if you update to 4.7.4.

Cheers

yes, Removing .h and .cpp files from source fixed the compiling issue, but still I can’t understand why it gives me this error

however, I’m updating the engine right now and I will report back once it completely downloaded.

the update didn’t fix the issue, still give the same error once I add a new class to parent class

I found the solution
I used
“const class FPostConstructInitializeProperties& PCIP”
instead of
“FObjectInitializer& PCIP”

this fixed the issue both for compiling and the name already exist issue