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:
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:
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:
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.