Hello,
I try to link a lib to ue4 but it dosen’t works.
I follow this tutorial : link text
My project name is ‘First’ and my lib is MathFuncsLib.
My file First.Build.cs look like :
// Fill out your copyright notice in the Description page of Project Settings.
using System.IO;
using UnrealBuildTool;
public class First : 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 First(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
LoadMathFuncsLib(Target);
// 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");
// }
// }
}
public bool LoadMathFuncsLib(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, "MathFuncsLib", "Libraries");
PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "MathFuncsLib." + PlatformString + ".lib"));
}
if (isLibrarySupported)
{
// Include path
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "MathFuncsLib", "Includes"));
}
Definitions.Add(string.Format("WITH_MathFuncsLib_BINDING={0}", isLibrarySupported ? 1 : 0));
return isLibrarySupported;
}
}
Finally my problem become with the point : “Visual Studio 2013 - Linking Our Library”
When I make :
// Fill out your copyright notice in the Description page of Project Settings.
#include "First.h"
#include "Welcome/to/MathFuncsLib.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, First, "First" );
I have this error : error C1083: Cannot open include file: ‘Welcome/to/MathFuncsLib.h’: No such file or directory
Best Regards,