Download

How do you link a DLL to a plugin?

So I have some code I didn’t write in front of me and it mostly makes sense. To build it however it requires the addition of an SDK in the form of a DLL.

What I’ve worked out so far is to add everything to “Thirdparty/MySDK” with the *.h files under “Includes” and the .lib file under “Libraries”. This path is in relation to the game project, not the plugin. Is that correct?

I also have a .dll file, where does that go? How do I connect it up, or does it load it based on the *.lib name?

The code uses AddThirdPartyPrivateStaticDependencies() in the Module rules/build file and calls something I don’t think I can find in the project. This third party static dependency - what is it expecting? If the line is AddThirdPartyPrivateStaticDependencies(Target, “MyThing”), what is “MyThing”?

I found an example that led me to do this inside the module build file:



PublicDelayLoadDLLs.Add("ThirdParty/MyThing/Libraries/MyDll.dll");
PublicIncludePaths.AddRange(new string] { "ThirdParty/MyThing/Includes" });
PublicAdditionalLibraries.Add("ThirdParty/MyThing/Libraries/MyLib.lib");


Is this the right way to do it?

As you can see it’s all new to me, so some insight would be appreciated. Feel free to comment on other things you think I need to know as well.