Unresolved Externals Error when compiling- Issue with "PawnKilled()"?

Hi,

I’m getting some strange compile errors after trying to compile after making the KillEmAllGameMode. It seems to saying there are “unresolved externals” dealing with “PawnKilled”. When I created the C++ class I also got a message saying the class was successfully created, but would not be available in UE4 until I compile. I wasn’t able to compile due to the above mentioned error. I’ll include some screenshots of the relavent code and errors.

Any help is greatly appreciated, thanks!

Error:

tsLog: Error: SimpleShooterGameModeBase.gen.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ASimpleShooterGameModeBase::PawnKilled(class APawn *)” (?PawnKilled@ASimpleShooterGameModeBase@@UEAAXPEAVAPawn@@@Z)
CompilerResultsLog: Error: KillAllGameMode.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ASimpleShooterGameModeBase::PawnKilled(class APawn *)” (?PawnKilled@ASimpleShooterGameModeBase@@UEAAXPEAVAPawn@@@Z)
CompilerResultsLog: Error: MainCharacter.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ASimpleShooterGameModeBase::PawnKilled(class APawn *)” (?PawnKilled@ASimpleShooterGameModeBase@@UEAAXPEAVAPawn@@@Z)
CompilerResultsLog: Error: SimpleShooterGameModeBase.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ASimpleShooterGameModeBase::PawnKilled(class APawn *)” (?PawnKilled@ASimpleShooterGameModeBase@@UEAAXPEAVAPawn@@@Z)
CompilerResultsLog: Error: KillAllGameMode.gen.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ASimpleShooterGameModeBase::PawnKilled(class APawn *)” (?PawnKilled@ASimpleShooterGameModeBase@@UEAAXPEAVAPawn@@@Z)
CompilerResultsLog: Error: E:\Epic Games\Unreal Projects\SimpleShooter\Binaries\Win64\UE4Editor-SimpleShooter-0131.dll : fatal error LNK1120: 1 unresolved externals

Didn’t Sam get the same error when creating the class? He had to add something in the SimpleShooter.build.cs. Now, if I remember correctly, he added “GameplayTasks” and “UMG” somewhere in that file. Have you done that?
EDIT - Also , you can use enclose your code/error message by selecting it and using Ctrl + Shift + C.

That says you didn’t define the function.

Hey Dan,

I did end up realizing I didn’t define the function and had moved on with the video assuming I had done it. I guess I was moving too fast with the video. Thanks!

I think the issue here was I missed the step where we were supposed to implement the code, and I had moved on without it. My code was trying to call on a function that wasn’t defined.

That said, I’m currently having issues with the “UMG” thing you mentioned. I’m currently on the “Displaying A Lose Message” video, and have gotten an LNK2019 error. Under the video is someone saying they had this error, and Dan mentioned they “needed to add UMG to the Build.cs”.

I don’t remember seeing any instructions for this, could you point me in the direction for what he is talking about? I must have just missed the video somehow.

Thanks!

You have to add , "UMG" in the SimpleShooter.build.cs file line number 11 just before the curly braces like this -

PublicDependencyModuleNames.AddRange(new string[] { "Core", CoreUObject", "Engine", "InputCore", "GameplayTasks", "UMG"});

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

Privacy & Terms