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

**URL:** <https://forums.unrealengine.com/t/what-is-the-correct-way-to-link-to-3rd-party-software/281577>\
**Category:** Pipeline & Plugins\
**Tags:** include, unreal-engine, unrealbuildtool, Visual-Studio, question\
**Created:** [April 25, 2014, 9:43am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-to-link-to-3rd-party-software/281577 "2014-04-25T09:43:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [April 25, 2014, 9:43am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-to-link-to-3rd-party-software/281577/1 "2014-04-25T09:43:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![twiddle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@twiddle](https://forums.unrealengine.com/u/twiddle)\
**Post date:** [April 25, 2014, 10:35am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-to-link-to-3rd-party-software/281577/2 "2014-04-25T10:35:56Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [April 25, 2014, 3:31pm UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-to-link-to-3rd-party-software/281577/3 "2014-04-25T15:31:07Z")

</div>

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.
