x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[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. https://answers.unrealengine.com/questions/200578/undefined.html

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:- alt text

alt text

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

Thanks a lot.

Product Version: Not Selected
Tags:
34554-capture.png (68.6 kB)
34556-2.png (101.5 kB)
more ▼

asked Mar 31 '15 at 10:10 PM in Bug Reports

avatar image

Omar Vector
435 16 16 29

avatar image Omar Vector Apr 01 '15 at 06:12 AM

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;
 
 
 
 };


avatar image Omar Vector Apr 01 '15 at 06:14 AM

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);
 
 }
avatar image Omar Vector Apr 02 '15 at 04:15 PM

Any Help?!

avatar image Omar Vector Apr 01 '15 at 11:32 AM

Any help yet?

avatar image matmow Apr 01 '15 at 12:03 PM

I was right, you have default constructor declaration but no implementation :) "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 :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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

more ▼

answered Apr 05 '15 at 10:21 PM

avatar image

Omar Vector
435 16 16 29

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

Doug Wilson

more ▼

answered Apr 03 '15 at 02:21 PM

avatar image Omar Vector Apr 03 '15 at 02:36 PM

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.

avatar image Omar Vector Apr 05 '15 at 10:15 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question