What is the correct way to link to 3rd party software?

Usually I’d specify the include and lib paths for a project in Visual Studio in the project properties. This works, but understandably as soon as you run the UE4 tool for refreshing the VS project it is wiped.

How would I go about placing a 3rd party include and lib using the Unreal build tools?

Your best bet would be to take a look at the modules under Engine\Source\ThirdParty. I’ve created a ThirdParty module by looking at the .build.cs files in the modules, in particular LibOVR/Oculus, which has a build.cs that shows you how to link different libraries based on x64/x86 etc. Mind you, I still had to manually copy the dlls to the Binaries subfolders, but if you’re statically linking that wouldn’t be a problem…

I’ve managed to get it working with putting these lines in the *.build.cs file:

PrivateIncludePaths.Add(PATH_TO_YOUR_INCLUDE);
PublicAdditionalLibraries.Add(PATH_TO_YOUR_LIBS);

Note: I found the only way to reference the lib was the absolute path to the file. I tried setting the directory via PublicLibraryPaths.Add, and setting the file via PublicAdditionalLibraries : didn’t seem to work. You might have better luck with your particular path however.

Edit: few hours later, seems stable transfering over project and refreshing VS builds.