How to tell UBT about library to get past Error LNK2019

Inside a BlueprintFunctionLibrary I want to use a library for the code I need, and to do that from what I read from here I need to add into UBT a link to that library. And to do that, this seems to be the line that I need to add PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib", "foo.a"));. Now the problem is that I don’t know what each parameters stand for. Can someone explain them?
What I need to tell it is that I’m using jvm.lib from this location: C:\Program Files\Java\jdk1.8.0_333\lib

Also the header files for it I added them into VC++ Directories/Include Directories. Is that what I should have done? Or beside that I need to also do something else for the header files?

One more thing just to be sure, that line of code I need to add it into TestProject.Build.cs from …\TestProject\Source\TestProject?

Hey,

Quite some time ago I needed to add a third party library as well. What helped me was this article here:

http://www.valentinkraft.de/including-the-point-cloud-library-into-unreal-tutorial/

I hope it helps you as well.

Cheers

1 Like

The solution for my case was adding the following lines in TestProject.Build.cs file (I wanted to use jvm.lib):

PublicDefinitions.Add("WITH_MYTHIRDPARTYLIBRARY=1");

PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "C:\\Program Files\\Java\\jdk1.8.0_333\\include"));
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "C:\\Program Files\\Java\\jdk1.8.0_333\\include\\win32"));

PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "C:\\Program Files\\Java\\jdk1.8.0_333\\lib\\jvm.lib"));