# Can't include boost libraries

**URL:** <https://forums.unrealengine.com/t/cant-include-boost-libraries/382450>\
**Category:** Mobile\
**Tags:** libraries, unreal-engine, compile-error, question\
**Created:** [January 20, 2017, 10:27am UTC](https://forums.unrealengine.com/t/cant-include-boost-libraries/382450 "2017-01-20T10:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [January 20, 2017, 10:27am UTC](https://forums.unrealengine.com/t/cant-include-boost-libraries/382450/1 "2017-01-20T10:27:11Z")

</div>

Hi, I’m trying to use the Boost libraries within Unreal,  
but I always get the error

```
Cannot open source file "boost/interprocess/allocators/allocator.hpp"

```

and so on.

This is my build file

using [System.IO](http://System.IO);  
using UnrealBuildTool;

public class varest : ModuleRules  
{  
private string ModulePath  
{  
get { return ModuleDirectory; }  
}

```
private string ThirdPartyPath
{
    get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}
public varest(TargetInfo Target)
{
	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });

	PrivateDependencyModuleNames.AddRange(new string[] { });

    // Uncomment if you are using Slate UI
    // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

    // Uncomment if you are using online features
    // PrivateDependencyModuleNames.Add("OnlineSubsystem");

    // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
    LoadBoost(Target);
}

public bool LoadBoost(TargetInfo Target)
{
    bool isLibrarySupported = false;

    if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
    {
        isLibrarySupported = true;

        string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
    }

    if (isLibrarySupported)
    {
        // Include path
       PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Boost", "Includes", "boost"));
    }

    Definitions.Add(string.Format("WITH_BOOST_BINDING={0}", isLibrarySupported ? 1 : 0));

    return isLibrarySupported;
}

```

}

Can some one help? Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_88d57b37](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_88d57b37](https://forums.unrealengine.com/u/anonymous_user_88d57b37)\
**Post date:** [August 18, 2017, 1:09pm UTC](https://forums.unrealengine.com/t/cant-include-boost-libraries/382450/2 "2017-08-18T13:09:49Z")

</div>

I recently made a tutorial on how to include external libraries into unreal (such as boost) on my blog:

A template to be used as a starting point for a custom boost / PCL plugin can be downloaded here:
