Hi [mention removed],
Overall Epic recommends to add all the logic of your library within a third party plugin. This would require a prebuilt + headers of course. Epic has a relevant example that could help to set everything up if you end up using the plugin system for your library:
`// Copyright Epic Games, Inc. All Rights Reserved.
include “ExampleTPP.h”
include “Misc/MessageDialog.h”
include “Modules/ModuleManager.h”
include “Interfaces/IPluginManager.h”
include “Misc/Paths.h”
include “HAL/PlatformProcess.h”
include “ExampleTPPLibrary/ExampleLibrary.h”
#define LOCTEXT_NAMESPACE “FExampleTPPModule”
void FExampleTPPModule::StartupModule()
{
/**/
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
// Get the base directory of this plugin
FString BaseDir = IPluginManager::Get().FindPlugin(“ExampleTPP”)->GetBaseDir();
// Add on the relative location of the third party dll and load it
FString LibraryPath;
#if PLATFORM_WINDOWS
LibraryPath = FPaths::Combine(*BaseDir, TEXT(“Binaries/ThirdParty/ExampleTPPLibrary/Win64/ExampleLibrary.dll”));
#elif PLATFORM_MAC
LibraryPath = FPaths::Combine(*BaseDir, TEXT(“Source/ThirdParty/ExampleTPPLibrary/Mac/Release/libExampleLibrary.dylib”));
#elif PLATFORM_LINUX
LibraryPath = FPaths::Combine(*BaseDir, TEXT(“Binaries/ThirdParty/ExampleTPPLibrary/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so”));
#endif // PLATFORM_WINDOWS
ExampleLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;
if (ExampleLibraryHandle)
{
// Call the test function in the third party library that opens a message box
//ExampleLibraryFunction();
}
else
{
//FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(“ThirdPartyLibraryError”, “Failed to load example third party library”));
}
}
void FExampleTPPModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
// Free the dll handle
FPlatformProcess::FreeDllHandle(ExampleLibraryHandle);
ExampleLibraryHandle = nullptr;
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FExampleTPPModule, ExampleTPP)`This module code loads a precompiles dll. There are comments all around so it should be easy to understand.
This would also require that you still need to precompile your library. I would say to add some extra steps in the compilation of visual studio that copies to the Unreal plugin library as a quick work around but it looks implementing your library as part of the development is not intended by default by how unreal is expected. Would ask again and see if I can get any extra information.
Best Regards,
Joan