UBT error : Failed to produce item

I was using the 4.2.1 engine with the third person template when the problem occurred. There was no problems when i first build the project with no changes.

I’m gonna put the error message below this with the line of interest marked with bold text. Below that I’m putting the header file and the source file.

btw: It is a actor class.

I Have removed the hashtags for the sake of not getting hilarious big text pieces.

ERROR MESSAGE:
1>------ Build started: Project: TutorialCode, Configuration: DebugGame_Editor x64 ------
1> Performing 2 actions (max 4 parallel jobs)
1> Pickup.cpp
1>C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\Source\TutorialCode\Pickup.cpp(23): error C2039: ‘SetSimulatePhyics’ : is not a member of ‘UStaticMeshComponent’
1> c:\program files\epic games\4.2\engine\intermediate\build\win64\inc\engine…/…/…/…/…/Source/Runtime/Engine/Classes/Components/StaticMeshComponent.h(175) : see declaration of ‘UStaticMeshComponent’
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode-Win64-DebugGame.dll
1> Cumulative action seconds (8 processors): 0,00 building projects, 0,14 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
1> UBT execution time: 3,97 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““C:\Program Files\Epic Games\4.2\Engine\Build\BatchFiles\Build.bat” TutorialCodeEditor Win64 DebugGame “C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\TutorialCode.uproject” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Header class
pragma once

include “GameFramework/Actor.h”
include “Pickup.generated.h”

/**
*
*/
UCLASS()
class APickup : public AActor
{
GENERATED_UCLASS_BODY()

//
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Pickup)
bool bIsActive;

//
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
TSubobjectPtr<USphereComponent> BaseCollisionComponent;

//
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
TSubobjectPtr<UStaticMeshComponent> PickupMesh;

//
UFUNCTION(BlueprintNativeEvent)
void OnPickedUp();

};

Source class
include “TutorialCode.h”
include “Pickup.h”

APickup::APickup(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
//
bIsActive = true;

//
BaseCollisionComponent = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("BaseSphereComponent"));

//
RootComponent = BaseCollisionComponent;

//
PickupMesh = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("PickupMesh"));

//
PickupMesh->SetSimulatePhyics(true);

//
PickupMesh->AttachTo(RootComponent);

}

void APickup::OnPickedUp_Implementation()
{
//
}

Just a typo:

PickupMesh->SetSimulatePhyics(true);

should be

PickupMesh->SetSimulatePhysics(true);

Thank you, did not see that one. Just corrected it in my project, but i still get the same error so this didn’t solve it, but tanks you anyway :smiley:

Ah, OK. How about SetSimulatePhysics on the RootComponent instead then? The mesh is apparently just a static mesh, which, if I understand things correctly, cannot be a rigid body by itself. But the root should, I think.

Just tried and still the same error. I’m following the tutorial on the unreal engine youtube channel and she doesn’t do it either. Also when I checked the destination that caused the problem there was no file.

Since the build failed, there is no dll produced there, so it makes sense.

Can you post the new output log from the build after the typo was fixed?

1>------ Build started: Project: TutorialCode, Configuration: DebugGame_Editor x64 ------
1> Performing 2 actions (max 4 parallel jobs)
1> Pickup.cpp
1>c:\program files\epic games\4.2\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(621): error C2338: Subobject_Pointers_Must_Be_Compatible
1> C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\Source\TutorialCode\Pickup.cpp(20) : see reference to function template instantiation ‘TSubobjectPtr &TSubobjectPtr::operator =(const TSubobjectPtrConstructor &)’ being compiled
1> C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\Source\TutorialCode\Pickup.cpp(20) : see reference to function template instantiation ‘TSubobjectPtr &TSubobjectPtr::operator =(const TSubobjectPtrConstructor &)’ being compiled
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode-Win64-DebugGame.dll
1> Cumulative action seconds (8 processors): 0,00 building projects, 0,22 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
1> UBT execution time: 4,04 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““C:\Program Files\Epic Games\4.2\Engine\Build\BatchFiles\Build.bat” TutorialCodeEditor Win64 DebugGame “C:\Users\Onsberg\Documents\Unreal Projects\TutorialCode\TutorialCode.uproject” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

There u go. I did mark what I think is the source to the problem with bold text again.

Yeah, so that’s a different error, related to the instantiation of the SubobjectPtr this time. Unfortunately that’s something that has been changed around quite a lot recently, so depending on the exact version of the engine you’re using, different rules apply. I’m not the right person to give an answer to that, I’m afraid.

Okay, I’m gonna try to download 4.1.2 and 4.0.2 and see if it will work there.

BTW. the reason I don’t use a newer version is due to that the tutorial I’m following is pretty old.

That particular tutorial was probably done in 4.1. Hopefully it will build properly on that.

Thank you it looks like it solved it :smiley: