# Error LNK2019: unresolved external symbol

**URL:** <https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, CPP, question\
**Created:** [December 3, 2022, 8:10pm UTC](https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789 "2022-12-03T20:10:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrSpecjalPL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrSpecjalPL](https://forums.unrealengine.com/u/MrSpecjalPL)\
**Post date:** [December 3, 2022, 8:10pm UTC](https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789/1 "2022-12-03T20:10:02Z")

</div>

I copied a code from this [link](https://nerivec.github.io/old-ue4-wiki/pages/get-available-screen-resolutions-in-blueprints.html) and transfered it to ue5 and i’ve come across this error:

```auto
BPFL_Game_Settings_Helpers.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class FDynamicRHI * GDynamicRHI" (__imp_?GDynamicRHI@@3PEAVFDynamicRHI@@EA) referenced in function "public: static class TArray<struct FScreenResolutionRHIBP,class TSizedDefaultAllocator<32> > __cdecl UBPFL_Game_Settings_Helpers::GetDisplayAdapterScreenResolutions(void)" (?GetDisplayAdapterScreenResolutions@UBPFL_Game_Settings_Helpers@@SA?AV?$TArray@UFScreenResolutionRHIBP@@V?$TSizedDefaultAllocator@$0CA@@@@@XZ)

```

BPFL\_Game\_Settings\_Helpers.h

```auto
#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "BPFL_Game_Settings_Helpers.generated.h"

USTRUCT(BlueprintType)
struct FScreenResolutionRHIBP
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ScreenResolution)
		int32 Width;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ScreenResolution)
		int32 Height;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ScreenResolution)
		int32 RefreshRate;

	FScreenResolutionRHIBP()
	{
		Width = Height = RefreshRate = 0;
	}
};

UCLASS()
class CHESS_API UBPFL_Game_Settings_Helpers : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
		
public:

	UFUNCTION(BlueprintPure, Category = Utility)
		static TArray<struct FScreenResolutionRHIBP> GetDisplayAdapterScreenResolutions();
};

```

BPFL\_Game\_Settings\_Helpers.cpp

```auto
#include "BPFL_Game_Settings_Helpers.h"
#include "RHI.h"

TArray<FScreenResolutionRHIBP> UBPFL_Game_Settings_Helpers::GetDisplayAdapterScreenResolutions()
{
	TArray<FScreenResolutionRHIBP> ResolutionsToReturn;
	FScreenResolutionArray Resolutions;
	if (RHIGetAvailableResolutions(Resolutions, false))
	{
		// Preallocate memory to store all elements
		ResolutionsToReturn.Reserve(Resolutions.Num());

		for (const FScreenResolutionRHI& EachResolution : Resolutions)
		{
			FScreenResolutionRHIBP resolution;
			resolution.Width = EachResolution.Width;
			resolution.Height = EachResolution.Height;
			resolution.RefreshRate = EachResolution.RefreshRate;

			ResolutionsToReturn.Add(resolution);
		}
	}

	return ResolutionsToReturn;
}

```

---

<div class="post-metadata">

**Author:** ![Klian](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/klian/32/1207571_2.png) [@Klian](https://forums.unrealengine.com/u/Klian)\
**Post date:** [December 3, 2022, 9:43pm UTC](https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789/2 "2022-12-03T21:43:44Z")

</div>

Go to your PROJECTNAME.Build.cs file, open it and add “RHI” in your PublicDependencyModuleNames list.

When you get that message you should google the class name your error is pointing to and check which module dependecy you need to add to your project.

> **[FDynamicRHI](https://docs.unrealengine.com/4.27/en-US/API/Runtime/RHI/FDynamicRHI/)**
>
> The interface which is implemented by the dynamically bound RHI.

---

<div class="post-metadata">

**Author:** ![MrSpecjalPL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrSpecjalPL](https://forums.unrealengine.com/u/MrSpecjalPL)\
**Post date:** [December 4, 2022, 8:31am UTC](https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789/3 "2022-12-04T08:31:02Z")

</div>

Thanks a lot

---

<div class="post-metadata">

**Author:** ![mclark4386](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mclark4386](https://forums.unrealengine.com/u/mclark4386)\
**Post date:** [October 27, 2023, 10:15pm UTC](https://forums.unrealengine.com/t/error-lnk2019-unresolved-external-symbol/720789/4 "2023-10-27T22:15:45Z")

</div>

I seem to be having a similar issue, but I can’t figure out what the missing module would be. Would you mind taking a look over there → [Can not link plugin](https://forums.unrealengine.com/t/can-not-link-plugin/1348568)
