I don’t know in what there can be a problem?
I want to add to ue4 to the project external dll with static linkage:
using UnrealBuildTool;
using System.IO;
public class TestThirdPerson : ModuleRules
{
public TestThirdPerson(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore” });
LoadBobsMagic(Target);
}
private string ModulePath
{
get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
}
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "..\\..\\..\\..\\")); }
}
public bool LoadBobsMagic(TargetInfo Target)
{
bool isLibrarySupported = false;
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
{
isLibrarySupported = true;
PublicDelayLoadDLLs.Add(Path.Combine(ModulePath, "Mech_anime_15.dll"));
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "lib15\\Mech_anime_15.lib"));
}
if (isLibrarySupported)
{
// Include path
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Include"));
}
Definitions.Add(string.Format("WITH_BOBS_MAGIC_BINDING={0}", isLibrarySupported ? 1 : 0));
return isLibrarySupported;
}
}
All compile is ok.
But process start is fail:
…
‘TestThirdPerson.exe’ (Win32): Loaded ‘G:\Mech_anime_git\UE4\TestThirdPerson\Binaries\Win64\Mech_anime_15.dll’. Symbols loaded.
…
Exception thrown at 0x000007FEFD1A940D in TestThirdPerson.exe: Microsoft C++ exception: xSharedMemoryException at memory location 0x000000000051F290.
‘TestThirdPerson.exe’ (Win32): Loaded ‘C:\Windows\System32\cryptbase.dll’. Cannot find or open the PDB file.
‘TestThirdPerson.exe’ (Win32): Loaded ‘C:\Windows\System32\sspicli.dll’. Cannot find or open the PDB file.
‘TestThirdPerson.exe’ (Win32): Loaded ‘C:\Windows\System32\uxtheme.dll’. Cannot find or open the PDB file.
[2015.12.29-15.03.26:025][ 0]LogModuleManager:Warning: ModuleManager: Module ‘HTTPChunkInstaller’ not found - its StaticallyLinkedModuleInitializers function is null.
…