'I am getting Linker error LNK2019 in one of my modules in UE_4.26

I am trying to implement a module in UE_4.26 project where I am getting Linker Error like the following:

ChunkDemoGameInstance.cpp.obj: error LNK2019: unresolved external symbol "public: static int __cdecl 
FChunkDownloaderDBWrapper::GetDatabase(class SQLiteDriver *)" (?GetDatabase@FChunkDownloaderDBWrapper@@SAHPEAVSQLiteDriver@@@Z) referenced in function "public: void __cdecl 
UChunkDemoGameInstance::OnPatchVersionResponse(class TSharedPtr<class IHttpRequest,1>,class TSharedPtr<class IHttpResponse,1>,bool)" (?OnPatchVersionResponse@UChunkDemoGameInstance@@QEAAXV?$TSharedPtr@VIHttpRequest@@$00@@V?$TSharedPtr@VIHttpResponse@@$00@@_N@Z)

I was not getting this error earlier when I was compiling my code in VS2019 but now when I try to compile it gives the above error.



Solution 1:[1]

Can you update your post to include your Build.cs file for your module and your project? You need to make sure that you add your libraries to the module's build.cs file and in your project build.cs file you must add the module name as a module to be loaded by Unreal build tool during compile.

if (Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicSystemLibraries.Add("kernel32.lib");
        }

Here's an example of adding the kernel32.lib file to be used during a build.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan Glenn