# Has anybody been successful using libnoise in UE4?

**URL:** <https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 6, 2014, 9:26pm UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768 "2014-11-06T21:26:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brainshack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brainshack](https://forums.unrealengine.com/u/Brainshack)\
**Post date:** [November 6, 2014, 9:26pm UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/1 "2014-11-06T21:26:19Z")

</div>

Hi,

so I am trying to use libnoise inside my UE4 project. I tried settings up the UBT stuff like explained in this Wiki Page:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

I used the .lib file you can find on the website of libnoise and added the includes. Everything as mentioned in the above tutorial.

However, when I try to compile, I still get linker problems:

```auto

Error	11	error : Failed to produce item: C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Binaries\Win64\UE4Editor-ProceduralMesh.dll	C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Intermediate\ProjectFiles\ERROR	ProceduralMesh
Error	10	error LNK1120: 3 unresolved externals	C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Binaries\Win64\UE4Editor-ProceduralMesh.dll	1	1	ProceduralMesh
Error	8	error LNK2019: unresolved external symbol "public: __cdecl noise::module::Perlin::Perlin(void)" (??0Perlin@module@noise@@QEAA@XZ) referenced in function "public:__cdecl AGameGeneratedActor::AGameGeneratedActor(class FPostConstructInitializeProperties const &)" (??0AGameGeneratedActor@@QEAA@AEBVFPostConstructInitializeProperties@@@Z)	C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Intermediate\ProjectFiles\GameGeneratedActor.cpp.obj	ProceduralMesh
Error	7	error LNK2019: unresolved external symbol "public: virtual __cdecl noise::module::Module::~Module(void)" (??1Module@module@noise@@UEAA@XZ) referenced in function "public:__cdecl AGameGeneratedActor::AGameGeneratedActor(class FPostConstructInitializeProperties const &)" (??0AGameGeneratedActor@@QEAA@AEBVFPostConstructInitializeProperties@@@Z)	C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Intermediate\ProjectFiles\GameGeneratedActor.cpp.obj	ProceduralMesh
Error	9	error LNK2019: unresolved external symbol "public: virtual double __cdecl noise::module::Perlin::GetValue(double,double,double)const " (?GetValue@Perlin@module@noise@@UEBANNNN@Z) referenced in function "public:__cdecl AGameGeneratedActor::AGameGeneratedActor(class FPostConstructInitializeProperties const &)" (??0AGameGeneratedActor@@QEAA@AEBVFPostConstructInitializeProperties@@@Z)	C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\Intermediate\ProjectFiles\GameGeneratedActor.cpp.obj	ProceduralMesh
Error	12	error MSB3073: The command ""D:\dev\Unreal Engine 4\Unreal Engine\4.4\Engine\Build\BatchFiles\Build.bat" ProceduralMeshEditor Win64 Development "C:\Users\Christian\Documents\Unreal Projects\UE4ProceduralMesh\ProceduralMesh.uproject" -rocket" exited with code -1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets	38	5	ProceduralMesh

```

This is how my build.cs file looks:

```auto

using UnrealBuildTool;
using System.IO;

public class ProceduralMesh : ModuleRules
{
    private string ModulePath
    {
        get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
    }

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

		PrivateDependencyModuleNames.AddRange(new string] { "RHI", "RenderCore", "ShaderCore" });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");
		// if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
		// {
		// if (UEBuildConfiguration.bCompileSteamOSS == true)
		// {
		// DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
		// }
		// }

        LoadLibNoise(Target);
	}
    public bool LoadLibNoise(TargetInfo Target)
    {
        bool isLibrarySupported = false;

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

            string LibrariesPath = Path.Combine(ThirdPartyPath, "LibNoise", "Libraries");

            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libnoise.lib"));
        }

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

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

        return isLibrarySupported;
    }

}

```

As far as I can tell, with my little C# knowledge, everything looks fine, and UBT is not complaining about files that cannot be found.

I also added the includes files to my VS2013 Project Settings, but if I understand correctly, UBT does not really care about those, right?

I also tried to compile libnoise on my own but couldnt get it to work with VS2013.

Any help would be highly appreciated.

---

<div class="post-metadata">

**Author:** ![Shockwave-peter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shockwave-peter](https://forums.unrealengine.com/u/Shockwave-peter)\
**Post date:** [November 7, 2014, 10:14am UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/2 "2014-11-07T10:14:22Z")

</div>

As far as I know, you can’t use libs compiled in another compiler or even another version of VS compiler. So you must compile your lib

> [@](#):
>
> I also added the includes files to my VS2013 Project Settings, but if I understand correctly, UBT does not really care about those, right?

```auto

PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "LibNoise", "Includes")); 

```

this line adds all lib related includes.

> [@](#):
>
> I also tried to compile libnoise on my own but couldnt get it to work with VS2013.

What errors do you receive?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_312e1e481](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_312e1e481](https://forums.unrealengine.com/u/anonymous_user_312e1e481)\
**Post date:** [August 9, 2015, 2:20pm UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/3 "2015-08-09T14:20:15Z")

</div>

I’ve also been trying to get libnoise working inside of UE4. Followed the same steps as Brainshack

I also rebuild Libnoise for 64bit in VS2013

```auto

// Fill out your copyright notice in the Description page of Project Settings.

// https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System

using UnrealBuildTool;
using System.IO;
using System;

public class ELE : ModuleRules
{
    private string ModulePath
    {
        get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
    }

    private string ThirdPartyPath
    {
        get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
    }

	public ELE(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore" });

		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");
		// if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
		// {
		// if (UEBuildConfiguration.bCompileSteamOSS == true)
		// {
		// DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
		// }
		// }

        LoadLibnoise(Target);
	}

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

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

            string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
            string LibrariesPath = Path.Combine(ThirdPartyPath, "Libnoise", "Libraries");

            Console.WriteLine(Path.Combine(LibrariesPath, "libnoise.lib")); 
            //PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Libnoise." + PlatformString + ".lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libnoise.lib"));
            //PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libnoise.dll"));
        }

        if (isLibrarySupported)
        {
            Console.WriteLine(Path.Combine(ThirdPartyPath, "Libnoise", "Includes")); 
            // Include path
            PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Libnoise", "Includes"));
        }

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

        return isLibrarySupported;
    }
}

```

In one of my classes:

```auto

// Fill out your copyright notice in the Description page of Project Settings.

#include "Project.h"
#include "MyActor.h"

#include <iostream>
#include <noise.h>

using namespace noise;

// Sets default values
AMyActor::AMyActor()
{
 	// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AMyActor::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );
}

void AMyActor::ActivateSunShine( float something )
{
	//module::Perlin myModule;
	noise::module::Perlin myModule;

	double value = myModule.GetValue(1.25, 0.75, 0.50);
	//UE_LOG(LogTemp, Warning, TEXT(value));
}

```

Output when trying to build the solution:

> [@](#):
>
> 1\>------ Rebuild All started: Project: Project, Configuration: Development\_Editor x64 ------  
> 2\>------ Skipped Rebuild All: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------  
> 2\>Project not selected to build for this solution configuration  
> 1\> Cleaning ProjectEditor Binaries…  
> 1\> Compiling game modules for hot reload  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Libraries\libnoise.lib  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Includes  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Libraries\libnoise.lib  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Includes  
> 1\> Compiling game modules for hot reload  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Libraries\libnoise.lib  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Includes  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Libraries\libnoise.lib  
> 1\> C:\Users\Stuart\Dropbox\UE4\Project\ThirdParty\Libnoise\Includes  
> 1\> Parsing headers for ProjectEditor  
> 1\> Reflection code generated for ProjectEditor  
> 1\> Performing 8 actions (4 in parallel)  
> 1\> [3/8] Resource PCLaunch.rc  
> 1\> [2/8] Resource ModuleVersionResource.rc.inl  
> 1\> PCH.Project.h.cpp  
> 1\> MyActor.cpp  
> 1\> RoadNode2.cpp  
> 1\> Project.generated.cpp  
> 1\> Project.cpp  
> 1\> [8/8] Link UE4Editor-Project-8452.dll  
> 1\> Creating library C:\Users\Stuart\Dropbox\UE4\Project\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Project-8452.lib and object C:\Users\Stuart\Dropbox\UE4\Project\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Project-8452.exp  
> 1\>MyActor.cpp.obj : error LNK2019: unresolved external symbol “public: virtual \_\_cdecl noise::module::Module::~Module(void)” (??1Module@module@noise@@UEAA@XZ) referenced in function “public: virtual \_\_cdecl noise::module::Perlin::~Perlin(void)” (??1Perlin@module@noise@@UEAA@XZ)  
> 1\>MyActor.cpp.obj : error LNK2019: unresolved external symbol “public: \_\_cdecl noise::module::Perlin::Perlin(void)” (??0Perlin@module@noise@@QEAA@XZ) referenced in function “public: void \_\_cdecl AMyActor::ActivateSunShine(float)” (?ActivateSunShine@AMyActor@@QEAAXM@Z)  
> 1\>MyActor.cpp.obj : error LNK2019: unresolved external symbol "public: virtual double \_\_cdecl noise::module::Perlin::GetValue(double,double,double)const " (?GetValue@Perlin@module@noise@@UEBANNNN@Z) referenced in function “public: void \_\_cdecl AMyActor::ActivateSunShine(float)” (?ActivateSunShine@AMyActor@@QEAAXM@Z)  
> 1\>C:\Users\Stuart\Dropbox\UE4\Project\Binaries\Win64\UE4Editor-Project-8452.dll : fatal error LNK1120: 3 unresolved externals  
> 1\> -------- End Detailed Actions Stats -----------------------------------------------------------  
> 1\>ERROR : UBT error : Failed to produce item: C:\Users\Stuart\Dropbox\UE4\Project\Binaries\Win64\UE4Editor-Project-8452.dll  
> 1\> Total build time: 43.33 seconds  
> 1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(43,5): error MSB3075: The command ““C:\Program Files\Epic Games\4.8\Engine\Build\BatchFiles\Rebuild.bat” ProjectEditor Win64 Development “C:\Users\Stuart\Dropbox\UE4\Project\Project.uproject” -rocket” exited with code 5. Please verify that you have sufficient rights to run this command.  
> ========== Rebuild All: 0 succeeded, 1 failed, 1 skipped ==========

---

<div class="post-metadata">

**Author:** ![ioFlow\_Studios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ioflow_studios/32/1194555_2.png) [@ioFlow\_Studios](https://forums.unrealengine.com/u/ioFlow_Studios)\
**Post date:** [August 18, 2015, 5:16am UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/4 "2015-08-18T05:16:55Z")

</div>

It can’t find libnoise.dll (I put mine in /Binaries/Win32/ and it was happy).

Don’t forget to copy the model and module subfolders from the libnoise src directory to /ThirdParty/LibNoise/Includes as well (only need the .h files inside them though).

And last of all, I took out the “using namespace noise” line as it was causing ambiguous symbol definition errors, even with #include “AllowWindowsPlatformTypes.h” and #include “HideWindowsPlatformTypes.h” either side of the noise.h include.

(which I just learned about here: [https://answers.unrealengine.com/questions/27560/trouble-using-windows-includes-with-dword-int.html](https://answers.unrealengine.com/questions/27560/trouble-using-windows-includes-with-dword-int.html))

I haven’t had a chance to test it properly though, this is just with your example code above where you instantiate a perlin noise module.

---

<div class="post-metadata">

**Author:** ![ioFlow\_Studios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ioflow_studios/32/1194555_2.png) [@ioFlow\_Studios](https://forums.unrealengine.com/u/ioFlow_Studios)\
**Post date:** [August 18, 2015, 5:49am UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/5 "2015-08-18T05:49:00Z")

</div>

I should probably also mention that I built libnoise as a 32 bit build because there was no 64 bit option in the project configuration options in VS2013 and I don’t know how to add it 🙂

---

<div class="post-metadata">

**Author:** ![ioFlow\_Studios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ioflow_studios/32/1194555_2.png) [@ioFlow\_Studios](https://forums.unrealengine.com/u/ioFlow_Studios)\
**Post date:** [August 18, 2015, 12:45pm UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/6 "2015-08-18T12:45:53Z")

</div>

Bummer, bad news sorry.

Got home and can’t get it to work on my laptop installation of Unreal no matter what I try… (including all the above).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f6536928](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f6536928](https://forums.unrealengine.com/u/anonymous_user_f6536928)\
**Post date:** [August 15, 2017, 5:14pm UTC](https://forums.unrealengine.com/t/has-anybody-been-successful-using-libnoise-in-ue4/14768/7 "2017-08-15T17:14:06Z")

</div>

A few years later:

> **[GitHub - LaithS/libnoise: libnoise configured for x64 build](https://github.com/LaithS/libnoise)**
>
> libnoise configured for x64 build. Contribute to LaithS/libnoise development by creating an account on GitHub.
