How to properly package a plugin with dependency to other modules

Hey,

I’m trying to package my plugin that depends on another module. My error looks as follows :

I:\Epic Games\UE_4.17\Engine\Source\Editor/AnimationModifiers/Public/AnimationBlueprintLibrary.h(9): fatal error C1083: Cannot open include file: 'AnimationBlueprintLibrary.generated.h': No such file or directory

I’m using functions from the AnimationBlueprintLibrary and therefore I included it in the .cpp file that uses it.

#.cpp
#include "Editor/AnimationModifiers/Public/AnimationBlueprintLibrary.h"

Also, I added the corresponding module to my modules

   PublicDependencyModuleNames.AddRange(
            new string[]
            {
                "Core",
                "AnimationModifiers",
			}
            );

I’m using binary version of 4.17 for win10 with VS2017. The plugin itself compiles fine and works as intended.

What’s the mistake here?

You also need to add a “Plugins” section to your .uplugin file.

Something like:

...
"Modules": [
		{
			"Name": "YourPlugin",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault"
		}
	],
	"Plugins": [
		{
			"Name": "AnimationBlueprintLibrary",
			"Enabled": true
		}
	]

I’m afraid the AnimationBlueprintLibrary isn’t a plugin, neither could I find a plugin that relates to it :confused:

Ah, I see.

OK, so I’d recently solved linking/referencing a Plugin within another Plugin, but I’ve also had what you’re now hitting (I think/hope!).

Try adding the path to the includes in your .uplugin descriptor:

PublicIncludePaths.AddRange( new string[] { "AnimationModifiers/Public" } );

Make sure to use the correct path, as what I’ve written above might not be exact! Like as you’ve done in your #include.

I’m afraid I already tried that, should’ve mentioned that.

PublicIncludePaths.AddRange(
			new string[] {
                "Editor/AnimationModifiers/Public"
			}
			);

As well as trying to add the private include path. Can you reproduce the error when adding the AnimationBlueprintLibrary to your plugin and packaging it?

How are you packaging your plugin? Are you following instructions like this Wiki, or something else?

Also, what version of UE4 are you running? I spotted this AnswerHub post with something similar, but was fixed in 4.19.

The instructions from Rama are the same as when you click “package” in the plugin window ( tested it), it runs the automation tool. I’m running 4.17. Thank you for your patience and help :slight_smile: