Public and private dependency modules

Is anyone able to give me a quick run down on the difference between public and private dependency modules in Build.cs? I’m not sure which modules I should put in which or if it even makes a difference.

3 Likes

Hello, karltheawesome

The difference between public and private dependencies is that they are visible to public and or private code respectively.
Thus, when public is used functionality can be exposed to other editors or plugins, that depend on your game (or module).

If you like to learn more about modules in Unreal Engine 4, please go here:

https://docs.unrealengine.com/latest/INT/Programming/Modules/API/index.html

Hope this helped!

Good luck!

4 Likes

So if I add a module to the public dependency modules does that mean that my plugin can access files in both its public and private folders? Or does it mean that it’s public code is visible to my public code? Sorry I’m a bit confused by your explanation.

2 Likes

Public dependency modules are the ones that are required by your public source files. In ModuleRules class, you can find the following:

/// List of public dependency module names.  These are modules that are required by our public source files.
public List<string> PublicDependencyModuleNames = new List<string>();
    
/// List of private dependency module names.  These are modules that our private code depends on but nothing in our public include files depend on.
public List<string> PrivateDependencyModuleNames = new List<string>();
2 Likes

Cool, that makes sense. Thanks :slight_smile:

And where could we find the list of keynames? For example I can’t compile function with ThumbnailTools class

So much helpful.

You probably know, now, but the keynames are the filenames of the *.Build.cs files.