Download

FAQ - Modules and Plugins

May 31, 2021.Knowledge

FAQ - Common Issues when using Modules or Plugins

Note: Please also have a look at our companion article “Modules - Overview and Structure ” which gives an overview of what modules are and how to work with them.

How do i find out which module a class/header belongs to?

Each module will have a certain folder structure that you can easily recognize from the full file path, notably the Private and Public (and for older modules also the Classes) folders. These folders will always be located in the root directory of a module.
Example for the IAssetRegistry Interface:
D:\UE\Release-4.27\Engine\Source\Runtime\AssetRegistry\Public\IAssetRegistry.h

In this case you can see that the IAssetRegistry.h header is located inside a Public directory that is inside the AssetRegistry Folder. Thus you can infer that you need to add a dependency to the AssetRegistry module if you want to access this header in your application or plugin.

A module or Plugin is not yet loaded when it try to access it?

The module might have the wrong loading phase for your use-case:

When trying to access a module early in the engine startup it might not be loaded yet. An earlier loading phase (e.g. when implementing splash screens) can help.

I’m getting Undefined References or “No such File or Directory” errors when using classes or symbols from another module or the engine code.

Possible reasons include:

  • Missing module dependency:
    Check if the class/symbol that is creating the error is in an engine module that is not specified in your public or private dependencies.
    If the class/symbol is used in the public part, make sure the dependency is specified in the PublicDependencyModuleNames.
  • MODULENAME_API macro might be missing on the class/symbol you are trying to use. If this happens in an engine plugin or module, please report to Epic.
  • Class/Symbol/Header is not part of the public folder. In this case the only way to access the classes is if they are properly exported and part of the public API.
    Some Engine classes will not export specific classes (like UAssetRegistryImpl) and only export an interface instead (IAssetRegistry)
  • An additional game module is not built:
    Make sure the game module is listed both in the .uproject files and in the correct .Target.cs or Editor.Target.cs
1 Like