I have a problem in my cant and i cant fix it

i have an error in my code heres when i compile in ue

and heres the code


yes it is allot of screen shots but before i closed the other topic about the same thing
i had allot of screen shots so that why im sorry
but can someone help…

You are defining things again in Tank_.cpp

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

#include "Tank_.h"
#include <TankAimingComponent.cpp>

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

	// No need to protect points as added at construction
	TankAimingComponent = CreateDefaultSubobject<UTankAimingComponent>(FName("Aiming Component"));
}

void ATank_::SetBarrelReference(UTankBarrel* BarrelToSet)
{
	TankAimingComponent->SetBarrelReference(BarrelToSet);
}

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

// Called to bind functionality to input
void ATank_::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);

}

void ATank_::AimAt(FVector OutHitLocation)
{
	TankAimingComponent->AimAt(OutHitLocation, LaunchSpeed);
}

this is the cpp file for tank_

before all this i was looking in the cpp file and found nothing so i just ignored tank_.cpp and asked the question

Don’t include .cpp files.

1 Like

so should i just erase it and try compiling again??

ok so when when i compilled it showed this

and when i click the link it bring’s me here

You need to include the header not the cpp

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms