# LNK2019: unresolved external symbol - Help Please!

**URL:** <https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 10, 2022, 3:06am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264 "2022-05-10T03:06:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 3:06am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/1 "2022-05-10T03:06:53Z")

</div>

Hi all, I’m getting this issue at compile time and have no idea why:

Error:  
LNK2019: unresolved external symbol "\_\_declspec(dllimport) public: class USkeletalMeshSocket \* \_\_cdecl USkinnedMeshComponent::GetSocketByName(class FName)const " (\__imp_?GetSocketByName@USkinnedMeshComponent@@QEBAPEAVUSkeletalMeshSocket@@VFName@@@Z) referenced in function “public: virtual void \_\_cdecl AItemBase::CollectItem(void)” (?CollectItem@AItemBase@@UEAAXXZ)

This is the culprit method in my class:

```auto
void AItemBase::CollectItem()
{
	if (!GameInstanceRef) return;

	BaseMesh->SetCollisionResponseToChannel(ECC_Camera, ECR_Ignore);
	BaseMesh->SetCollisionResponseToChannel(ECC_Pawn, ECR_Ignore);
	BaseMesh->SetSimulatePhysics(false);

	APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
	if(ALLPlayer* Olivia = Cast<ALLPlayer>(PlayerPawn))
	{
		DisableCollisions();
		PlayQuipSound();
		bRotate = false;
		
		if (ItemInstanceEffect)
			ItemInstanceEffect->Deactivate();

		Olivia->InventoryItems.AddInventoryItem(UniqueName, this);
		GameInstanceRef->TriggerInventoryUpdated(this->UniqueName);

		const USkeletalMeshSocket* SMesh = Olivia->GetMesh()->GetSocketByName("RightHandSocket");
		if (SMesh)
			SMesh->AttachActor(this, Olivia->GetMesh());

		Olivia->InventoryItems.HideAllHandItems();
		Olivia->InventoryItems.RightHandSocketRef = this;
		ShowInHand();
		
		Olivia->InteractableItemRef = nullptr;
	}
}

```

I have the appropriate include too:  
#include “Engine/SkeletalMeshSocket.h”

This is so frustrating that I’m about to throw in the towel. Any ideas please?

Thank you

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [May 10, 2022, 3:23am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/2 "2022-05-10T03:23:29Z")

</div>

Hi Joofvllle1,

Try wrapping the “RightHandSocket” with “TEXT(“RightHandSocket”)” - it may be getting confused with you passing a single-byte string in rather than unicode.

---

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 6:15am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/3 "2022-05-10T06:15:43Z")

</div>

Thanks for the idea, tried it and the problem persists.

---

<div class="post-metadata">

**Author:** ![Fluppi393](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fluppi393](https://forums.unrealengine.com/u/Fluppi393)\
**Post date:** [May 10, 2022, 6:25am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/4 "2022-05-10T06:25:15Z")

</div>

The USkinnedMeshComponent is part of the engine module, the unresolved external symbol error is usually given when you forget to define a function or an engine module you are using is not included. Check your .Build.cs file if PublicDependencyModuleNames includes “Engine”

---

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 7:30am UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/5 "2022-05-10T07:30:10Z")

</div>

Hi, these are the contents of my build.cs file

```auto

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

using UnrealBuildTool;

public class LiviLocket : ModuleRules
{
	public LiviLocket(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });

		PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "Niagara" });
		
	}
}

```

---

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 6:17pm UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/6 "2022-05-10T18:17:49Z")

</div>

So I’ve tried a couple of things and still no result, this is the extent of the error I get.

```auto
 Creating library D:\development\unreal\LiviLocket\Intermediate\Build\Win64\UnrealEditor\Development\LiviLocket\UnrealEditor-LiviLocket.suppressed.lib and object D:\development\unreal\LiviLocket\Intermediate\Build\Win64\UnrealEditor\Development\LiviLocket\UnrealEditor-LiviLocket.suppressed.exp
ItemBase.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class USkeletalMeshSocket *__cdecl USkinnedMeshComponent::GetSocketByName(class FName)const " (__imp_?GetSocketByName@USkinnedMeshComponent@@QEBAPEAVUSkeletalMeshSocket@@VFName@@@Z) referenced in function "public: virtual void__cdecl AItemBase::CollectItem(void)" (?CollectItem@AItemBase@@UEAAXXZ) [D:\development\unreal\LiviLocket\Intermediate\ProjectFiles\LiviLocket.vcxproj]
D:\development\unreal\LiviLocket\Binaries\Win64\UnrealEditor-LiviLocket.dll : fatal error LNK1120: 1 unresolved externals [D:\development\unreal\LiviLocket\Intermediate\ProjectFiles\LiviLocket.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""C:\Program Files\Epic Games\UE_5.0\Engine\Build\BatchFiles\Build.bat" LiviLocketEditor Win64 Development -Project="D:\development\unreal\LiviLocket\LiviLocket.uproject" -WaitMutex -FromMsBuild" exited with code 6. [D:\development\unreal\LiviLocket\Intermediate\ProjectFiles\LiviLocket.vcxproj]
Done Building Project "D:\development\unreal\LiviLocket\Intermediate\ProjectFiles\LiviLocket.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\development\unreal\LiviLocket\LiviLocket.sln" (Games\LiviLocket target(s)) -- FAILED.

```

I’ve added “Engine” to the build file:

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

```

---

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 6:41pm UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/7 "2022-05-10T18:41:28Z")

</div>

It seems it just doesn’t get where USkeletalMeshSocket is!

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [May 10, 2022, 7:35pm UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/8 "2022-05-10T19:35:03Z")

</div>

Yes most strange! The only other thing I can think of apart from re-downloading the UE source is to add the “Engine” module to the PrivateDependencyModuleNames as well/instead…

---

<div class="post-metadata">

**Author:** ![Joofville1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joofville1](https://forums.unrealengine.com/u/Joofville1)\
**Post date:** [May 10, 2022, 8:50pm UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/9 "2022-05-10T20:50:15Z")

</div>

So I uninstalled the engine and reinstalled it and that worked! Finally!  
Thanks for the tip appreciate it.

---

<div class="post-metadata">

**Author:** ![Raver460](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raver460](https://forums.unrealengine.com/u/Raver460)\
**Post date:** [February 19, 2023, 11:53pm UTC](https://forums.unrealengine.com/t/lnk2019-unresolved-external-symbol-help-please/553264/10 "2023-02-19T23:53:47Z")

</div>

As in you uninstalled unreal engine itself to solve the problem
