I am trying to incorporate the api from a third party into my UE4 project. The Third Party company API is defined in a set of DLLs, Libs, and header files. I have created a plugin using the Third Party Plugin template. I have managed to get the ThirdParty folder inside the plugin to access teh functions inside the DLLs and LIBs successfully. However, I am unable to access those functions outside the ThirdParty module. Any reference to a function inside the ThirdParty module returns some version of "Unresolved external symbol “” referenced in function “”
The Plugin .build.cs is as follows:
using System;
using System.IO;
using UnrealBuildTool;
public class Eyegaze : ModuleRules
{
private string ModulePath
{
get { return ModuleDirectory; }
}
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../ThirdParty/")); }
}
private string BinariesPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../Binaries/")); }
}
public Eyegaze(ReadOnlyTargetRules Target) : base(Target)
{
//Type = ModuleType.External;
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
//Path.Combine(ModulePath, "/Public"),
ThirdPartyPath,
"C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Source/Eyegaze/Public",
"C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Source/ThirdParty"
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
//Path.Combine(ModulePath, "/Private"),
"C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Source/Eyegaze/Private",
"C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Source/ThirdParty"
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core","CoreUObject", "Engine", "InputCore",
"EyegazeLibrary",
"Projects"
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core", "EyegazeLibrary"
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
//"EyegazeLibrary"
// ... add any modules that your module loads dynamically here ...
}
);
// Since the PCL module needs this, we also have to use these flags here
bUseRTTI = true;
bEnableExceptions = true;
PublicAdditionalLibraries.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Source/ThirdParty/EyegazeLibrary/x64/Release/ExampleLibrary.lib");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/ThirdParty/EyegazeLibrary/Win64/ExampleLibrary.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/ExampleLibrary.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/efcomm.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/egfileio.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/EyeKeysDLL.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/facefinder.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/fgcamera.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctigaze.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctutil.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctVision.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctVisionC0.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctVisionC5.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctVisionC6.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/slabhiddevice.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/STMRangeL1.dll");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctgaze.lib");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/lctutil.lib");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/EyeKeysDLL.lib");
RuntimeDependencies.Add("C:/Unreal Projects/TestSpace/Plugins/Eyegaze/Binaries/Win64/ExampleLibrary.lib");
}
}
The ThirdParty module build.cs inside the plugin folder is:
// Fill out your copyright notice in the Description page of Project Settings.
using System;
using System.IO;
using UnrealBuildTool;
public class EyegazeLibrary : ModuleRules
{
private string ModulePath
{
get { return ModuleDirectory; }
}
private string BinariesPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../Binaries/")); }
}
public EyegazeLibrary(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
LoadEGLib(Target);
}
public bool LoadEGLib(ReadOnlyTargetRules Target)
{
bool isLibrarySupported = false;
//bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT);
if (Target.Platform == UnrealTargetPlatform.Win64)
{
isLibrarySupported = true;
// Add the import library
PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib/lctigaze.lib"));
PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib/EyeKeysDLL.lib"));
PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib/lctutil.lib"));
PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "x64/Release/ExampleLibrary.lib"));
// Delay-load the DLL, so we can load it from the right place first
PublicDelayLoadDLLs.Add("ExampleLibrary.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/ExampleLibrary.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/efcomm.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/egfileio.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/EyeKeysDLL.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/facefinder.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/fgcamera.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctigaze.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctutil.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVision.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC0.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC5.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC6.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/slabhiddevice.dll");
PublicDelayLoadDLLs.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/STMRangeL1.dll");
// Ensure that the DLL is staged along with the executable
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/ExampleLibrary.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/efcomm.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/egfileio.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/EyeKeysDLL.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/facefinder.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/fgcamera.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctigaze.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctutil.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVision.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC0.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC5.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/lctVisionC6.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/slabhiddevice.dll");
RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/EyegazeLibrary/Win64/STMRangeL1.dll");
}
/*else if (Target.Platform == UnrealTargetPlatform.Mac)
{
PublicDelayLoadDLLs.Add(Path.Combine(ModuleDirectory, "Mac", "Release", "libExampleLibrary.dylib"));
RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/EyegazeLibrary/Mac/Release/libExampleLibrary.dylib");
}*/
if (isLibrarySupported)
{
PublicIncludePaths.Add(Path.Combine(ModulePath, "include"));
// Not sure if needed
//Definitions.Add("_CRT_SECURE_NO_WARNINGS=1");
//Definitions.Add("BOOST_DISABLE_ABI_HEADERS=1");
// Needed configurations in order to run Boost
bUseRTTI = true;
bEnableExceptions = true;
//bEnableUndefinedIdentifierWarnings = false;
}
//Definitions.Add(string.Format("WITH_PCL_BINDING={0}", isLibrarySupported ? 1 : 0));
//Definitions.Add(string.Format("WITH_BOOST_BINDING={0}", isLibrarySupported ? 1 : 0));
return isLibrarySupported;
}
}
I used @anonymous_user_88d57b37 's tutorial for building a plugin for point cloud and boost (http://www.valentinkraft.de/including-the-point-cloud-library-into-unreal-tutorial/) to get me top this point but I can’t figure out how to use the API outside of the module