Plugin Task Failed: Cannot open include file: 'Runnable.h': No such file or directory. (Plugin uses Multi-threading)

I want to package my plugin for UE 4.20 and unreal cannot find Runnable.h? I’m really confused because when I compile this normally I get no compile errors, but when I go to package the plugin for use in other projects, it fails. Do I have to include a certain module in my plugin’s build.cs file? This plugin makes use of multi-threading and I need this feature.

Things I’ve tried: (And still no luck)

  1. Deleted Build, Binaries, Intermediate, Saved and .vs folders (Regenerate VS files and rebuilt binaries)
  2. Cleaned and rebuilt entire project from Visual Studio 17
  3. Copied the entire project onto a different drive and tried to package the plugin from there.
  4. Deleted the class and recreated it.
  5. Removed #include "Runnable.h" (Gave me different error: Cannot open include file ‘RunnableThread.h’)
  6. Rebuilt the plugin module.
  7. Used the ‘Object’ class template instead of the empty one. (File>New C++ Class>Show All Classes>Object)

Here is some information: (If you need some more context)

  1. I’m packaging this for Windows 64-bit in UE 4.20
  2. I used the empty class template by going to File>New C++ Class>Empty
  3. The error happens at line 5 in the header file (linked below).
  4. AutomationTool exiting with ExitCode=5
  5. I’m packaging this plugin from the editor by going to Edit>Plugins>(Selecting my plugin)>Package
  6. Log file
  7. Header file

Any idea on what’s going on?

Thanks in advance for your answers and help.

Wow 5 minutes later, I fixed it! Haha.

All I did was use the full include path to Runnable.h, ThreadSingleton.h and RunnableThread.h

Then I went to Edit>Plugins>(Find my plugin)>Package to package my plugin

Plugin compiled successfully!

Here is a better fix

Start the include path to Runnable.h, ThreadSingleton.h and RunnableThread.h from their module’s name.

Like this: (Runnable.h resides in the Core module)

283383-plugin-header-fix-2.png

Then I went to Edit>Plugins>(Find my plugin)>Package, to package my plugin

Plugin compiled successfully!

Hope this helps anyone!!!

1 Like

Thank you! :slight_smile: