How to include the header file from a plugin

Hi, I used to have the same problem. You’ll need to put the name of the module you’re trying to include in your modules Build.cs file. In your solution explorer, there should be a file titled YourGameName.build.cs. You’ll see a line that looks like this:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

Just simply add the name of the new module on the end of the line, in the same style as the rest. You’ll also need to add the path to the include files, which will require adding a new line, something like…

PublicIncludePaths.AddRange(new string[] {"<Modulename>/Public", "<Modulename>/Classes" });

Then just simply include the headers as you normally would.

16 Likes