How link static library to project?

Hello everyone, I am a new unreal engine user.

I have a question about linking a static library to a UE4 project. I looked at a lot of documentation on this but there is no demo / tutorial. Most of the time, these are just forums that talk about issues. The recent wiki shutdown doesn’t help as a lot of people are talking about a tutorial link that no longer exists. Do you know where I can find a tutorial to help me?
This link is deprecated:

For information, I have the *.lib and *.h of another project that I would like to link to my UE4 project (4.24.3).
I have tried generating a ThirdParty plugin with the editor builder, but I can’t seem to call the default auto-create function. The inclusion of .h is not done.

Thank you for reading me, I only need to know the steps to follow in order to properly link my static library to my project.

Regards

Desperada, I made an archive of those articles. They are not in great shape, but you should be able to find it here:

You might also find an updated version here:

Thank you very much, it is a valuable job that you have done. However regarding my problem, I have not found a solution for the static libraries to link to a game project. You have referenced a guide to add a library to the engine directly, but it is incomplete.

I found a few days ago this guide recovered thanks to an archive but it seems deprecated.
http://web.archive.org/web/20140824192306/https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System
Edit:Also, I’ve just found this guide on your website.

1 Like

Hello,
I solved my problem by following this guide. It is very well explained and offers additional advice.

https://nerivec.github.io/old-ue4-wiki/pages/creating-linking-static-libraries-and-make-your-own-blueprint-node-with-vs-2017-ue4.html

So I close this topic.

Thank you.

2 Likes

I love this…that last link is also 404

In my case this solved issue (in MyPlugin.Build.cs)

using System.IO;
using System.Text.RegularExpressions;
using UnrealBuildTool;

public class MyPlugin: 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 MyPlugin(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "openh264/lib/openh264.lib"));

		PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "openh264/include"));

		PublicIncludePaths.AddRange(
			new string[] {
				// ... add public include paths required here ...
			}
			);
		PrivateIncludePaths.AddRange(
			new string[] {
				// ... add other private include paths required here ...
			}
			);
		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"InputCore", 
				// ... add other public dependencies that you statically link with here ...
			}
			);
		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",
				// ... add private dependencies that you statically link with here ...	
			}
			);
		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
				// ... add any modules that your module loads dynamically here ...
			}
			);
	}
}
1 Like