Keep getting errors when making changes to header or new classes.

Hi! I just recently started a new project, but I keep getting compiler errors when building new headers or changes to existing headers, and I can’t tell why.
I don’t have this issue with my older project.

This is all the code is so far:


#pragma once

#include "CoreMinimal.h"
#include "WinstickPawn.h"
#include "WSNPC.generated.h"

/**
*
*/
UCLASS()
class WINSTICK_API AWSNPC : public AWinstickPawn
{
GENERATED_BODY()


public:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Dialogue)
FString Dialogue;

AWSNPC();

protected:
virtual void BeginPlay() override;

public:
virtual void Tick(float DeltaTime) override;

virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

};



And these are the errors:


Severity Code Description Project File Line Suppression State
Error LNK1120 4 unresolved externals Winstick X:\Unreal\Unreal Projects\Winstick\Binaries\Win64\UE4Editor-Winstick.dll 1
Error MSB3073 The command "Z:\UE\UE_4.25\Engine\Build\BatchFiles\Rebuild.bat WinstickEditor Win64 Development -Project="X:\Unreal\Unreal Projects\Winstick\Winstick.uproject" -WaitMutex -FromMsBuild" exited with code -1. Winstick C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 49
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl AWSNPC::BeginPlay(void)" (?BeginPlay@AWSNPC@@MEAAXXZ) Winstick X:\Unreal\Unreal Projects\Winstick\Intermediate\ProjectFiles\WSNPC.gen.cpp.obj 1
Error LNK2001 unresolved external symbol "public: virtual void __cdecl AWSNPC::SetupPlayerInputComponent(class UInputComponent *)" (?SetupPlayerInputComponent@AWSNPC@@UEAAXPEAVUInputComponent@@@Z) Winstick X:\Unreal\Unreal Projects\Winstick\Intermediate\ProjectFiles\WSNPC.gen.cpp.obj 1
Error LNK2001 unresolved external symbol "public: virtual void __cdecl AWSNPC::Tick(float)" (?Tick@AWSNPC@@UEAAXM@Z) Winstick X:\Unreal\Unreal Projects\Winstick\Intermediate\ProjectFiles\WSNPC.gen.cpp.obj 1
Error LNK2001 unresolved external symbol "public: __cdecl AWSNPC::AWSNPC(void)" (??0AWSNPC@@QEAA@XZ) Winstick X:\Unreal\Unreal Projects\Winstick\Intermediate\ProjectFiles\WSNPC.gen.cpp.obj 1
Error LNK2019 unresolved external symbol "public: __cdecl AWSNPC::AWSNPC(void)" (??0AWSNPC@@QEAA@XZ) referenced in function "public: static void __cdecl AWSNPC::__DefaultConstructor(class FObjectInitializer const &)" (?__DefaultConstructor@AWSNPC@@SAXAEBVFObjectInitializer@@@Z) Winstick X:\Unreal\Unreal Projects\Winstick\Intermediate\ProjectFiles\WSNPC.cpp.obj 1



Any suggestions?

did you add the copy right comment at the top. It must be there or it won’t compile right.

Copyright Notice

Any source file (.h, .cpp, .xaml, etc.) provided by Epic for distribution must contain a copyright notice as the first line in the file. The format of the notice must exactly match that shown below:



// Copyright Epic Games, Inc. All Rights Reserved.

If this line is missing or not formatted properly, CIS will generate an error and fail.

Also make sure everything that is in your .h file is initialized in the .cpp file then those errors should go away. Make sure any function defined are over in the cpp file also That is what solved those errors for me.

You need to implement those functions.