Unresolved External Symbol Error

So I have been able to fix all my other problems through this course by looking it up on google or here so far. I have finally come to a point where I literally have tried all of those things, and every “solution” i have tried relating to this issue has not fixed it. So i have deleted my binaries and recreated them as suggested by others, which fixed most of intelisens issues (none of these stopped me from compiling or building they were just annoying) but now i am still back to square one with this same issue.

Here are some pictures of the error i am constantly getting, please if anyone has any idea what i should do to fix this or even the right direction to look towards i would really appreciate it. I have spent a couple days trying to figure this out now, and nothing seems to work. Thank you.

This is the first part of the error, it is too long for one picture so i had to take two.

This is the rest of the error.

Also here is all of my code that is affected by the errors.

TankAIController.CPP

TankAIController.H

TankPlayerController.CPP


TankPlayerController.H

Hi SturmWolf.

I just encountered the exact same problem. I noticed it only occurred after I’d changed the public methods in “Tank.h” to private, as Ben does in the lecture video.

The error message though references ATankAIController, which threw me at first until I noticed that “Tank.h” is #included in “TankAIController.h”. So, I decided to change the private methods back to public just as a test and lo-and-behold it compiled without error.

The weird thing is though - and if anyone can explain what may have caused this I would be eternally grateful - I changed it back to private again with the intention to re-create the error so I could study the log in more detail and see if I could figure out what was happening… and this time it compiled without error!

So in summary, unless something else entirely caused it and this is all coincidence; changing the public methods to private in “Tank.h” seems to have caused the problem, which was then solved by changing them back to public, compiling and then changing back to private again and recompiling.

That was literally the only thing I changed between compiles and it seems to have worked, somehow, so give it a try and see if it works for you.

Good luck!

I actually encountered this same “external symbol” type problem too, I believe after switching some things to private in the Tank.h. Unfortunately, I wasn’t able to fix this by simply reverting back to what I literally just had and compiling, or by doing really any combination of private/public across all headers. Pretty frustrating as it seems this issue got stuck somewhere under the hood and I couldn’t revert it.

Eventually though, instead of checking out an earlier commit, I just closed down VS, went to the project folder, and deleted basically whats ignored by gitignore (.vs, binaries, intermediate, saved, and the .sln file). Regenerated the solution from the uproject file and had it rebuild everything. This seems to have gotten rid of the problem and I can now properly set everything as public/private and compile.

This was causing me a lot of grief and it looks like it’s due to some quirkiness in how the latest versions of UE4 generate the Pawn c++ class. This Reddit thread couldn’t come up with a definitive answer as to why there were two publics in the generated header file, and there’s nothing in the Unreal documentation to explain it.

I have no clue why certain core functions have to be public or protected, but this is the default Tank.h

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

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "Tank.generated.h"

UCLASS()
class BATTLETANK_API ATank : public APawn
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	ATank();

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

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

	
	
};

Privacy & Terms