Hi there,
you have to add the third party lib to the project as a dependency. I will describe the way I do it in our project, where I link external static library (with multiple other runtime dependencies) to a plugin as a dependency.
In the root folder of the project, I have folder called deps with sub-folders include and lib. In the include sub-folder I have the .lib for the Windows and the .a for the OS X version of the project.
For the Windows version, you have to make sure you build the third party .lib in proper configuration - for Unreal Engine “Visual Studio 14 2015” 64 bit version will do.
The linking to the project is done in .Build.cs file. My .Build.cs file is located here:
ProjectDir/Plugins/PluginName/Source/ModuleName/ModuleName.Build.cs
BUT that is because I link the third party library as a dependency to the plugin. You will want to edit the .Build.cs here:
ProjectDir/Source/ProjectName/ProjectName.Build.cs and add some code to the function there.
First you need to determine the path to the deps folder - you can specify this path manually but because I develop is as a plugin that I need to be able to distribute to different project and computers, (just FYI) I get the path this way… First get the full path to the module directory:
string moduleDir = Path.GetFullPath(ModuleDirectory);
Then I parse out the the project directory path by cutting off the Plugins directory:
string projectDir = moduleDir.Substring(0, moduleDir.IndexOf("Plugins\\PluginName\\Source\\ModuleName"));
…and as a last step I append the folder name:
string dependencyFolder = Path.Combine(projectDir, "deps");
Now we can link the third party library. First add the folder with header files - they work as an API of the library and you will include those you need to your project.
PublicIncludePaths.Add(Path.Combine(dependencyFolder, "include"));
And now link the third party library:
PublicAdditionalLibraries.Add(Path.Combine(dependencyFolder, "thirdparty.lib"));
For Mac you can do the very same thing. If you don’t want to work with dynamic location of the project, just replace the dependencyFolder variable I use with real path to the deps directory in your project (something like: “C:\Project\deps”).
Good luck, hope this helps.