# what is the correct way of adding public dependencies path for plugin modules

**URL:** <https://forums.unrealengine.com/t/what-is-the-correct-way-of-adding-public-dependencies-path-for-plugin-modules/786983>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, custom-nodes, CPP\
**Created:** [March 9, 2023, 8:10am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-of-adding-public-dependencies-path-for-plugin-modules/786983 "2023-03-09T08:10:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![morbal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@morbal](https://forums.unrealengine.com/u/morbal)\
**Post date:** [March 9, 2023, 8:10am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-of-adding-public-dependencies-path-for-plugin-modules/786983/1 "2023-03-09T08:10:26Z")

</div>

im following this guide to make my own k2Nodes :

> **[Create Custom K2 Node For Blueprint | Unreal Engine Community Wiki](https://unrealcommunity.wiki/create-custom-k2-node-for-blueprint-zwuncdkq)**
>
> Contents: I will show you how to create real Blueprint Node using C++. Normally all you need is expose function from C++, back to blueprints, but creating custom node have big benefits. One the big...

to summarize it, it says you need two modules in a plugin, one for runtime and one for editor in editor module build.cs file i should add this :

```auto
 PublicIncludePaths.AddRange(
        new string[] {
            "YourRunTimeModule",
            "YourRunTimeModule/Public"
           // ... add public include paths required here ...
        }
    );

```

but i get this warning when trying to compile :  
warning : Referenced directory ‘C:\Program Files\Epic Games\UE\_5.1\Engine\Source\YourRunTimeModule/’ does not exist.  
warning : Referenced directory ‘C:\Program Files\Epic Games\UE\_5.1\Engine\Source\YourRunTimeModule/Public’ does not exist.

and later when writing custom nodes i get a ton of error messages  
so the workaround i found is that instead of writing “YourRunTimeModule” and “YourRunTimeModule/Public” i wrote the full path to my plugin like this:

```auto
 PublicIncludePaths.AddRange(
        new string[] {
            "D:/Projects/SampleProjectP/Plugins/MyPlugin/Source/YourRunTimeModule",
            "D:/Projects/SampleProjectP/Plugins/MyPlugin/Source/YourRunTimeModule/public"
           // ... add public include paths required here ...
        }
    );

```

and it works but just because it works doesn’t mean its correct, if i wanted to give this plugin to someone else or change the projects paths i need to rewrite this  
what is correct way of writing it?

---

<div class="post-metadata">

**Author:** ![morbal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@morbal](https://forums.unrealengine.com/u/morbal)\
**Post date:** [March 9, 2023, 9:01am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-of-adding-public-dependencies-path-for-plugin-modules/786983/2 "2023-03-09T09:01:56Z")

</div>

well it seems i wasn’t searching hard enough all i had to do was this

```auto
using System.IO
.
.
.
.
 PublicIncludePaths.AddRange(
        new string[] {
           Path.Combine(PluginDirectory,"Source/YourRunTimeModule"),
           Path.Combine(PluginDirectory,"Source/YourRunTimeModule/public"),

           // ... add public include paths required here ...
        }
    );

```

---

<div class="post-metadata">

**Author:** ![Dont\_Laugh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dont_laugh/32/467622_2.png) [@Dont\_Laugh](https://forums.unrealengine.com/u/Dont_Laugh)\
**Post date:** [June 10, 2025, 7:56am UTC](https://forums.unrealengine.com/t/what-is-the-correct-way-of-adding-public-dependencies-path-for-plugin-modules/786983/3 "2025-06-10T07:56:24Z")

</div>

Very good sharing 🫡
