"Add Code To Project" not working for DecalActor

I am not doing anything fancy, in 4.7.6 (Windows 8.1 64bit)

  • Created a brand new BLANK C++ Project with No Started Content in UE4 Editor
  • Clicked on Add Code To Project. Checked the All Classes checkbox. And found DecalActor class.
  • Clicked Next, kept the default name MyDecalActor. Clicked Create Class
  • Got error:

Failed to add class MyDecalActor. Failed to automatically compile “MyGame” module.

You should have some more details about why the build failed in the Output Log (Window → Developer Tools → Output Log), or your log file if you’ve since closed the editor (YourProject/Saved/Logs).

Could you post that here (or just attach your log), as that will help us know why your build is failing.

Thank you for the very quick response. Log is attachedlink text (name of my project is CW2)

It looks like ADecalActor isn’t fully exported from its module, which leads to the linker errors you’re seeing in the output log.

Either some more functions need marking with ENGINE_API, or, and more likely, we should remove MinimalAPI from the class and just ENGINE_API the entire thing.

I’ll try and get that sorted out tomorrow, but it will take a while for it to trickle through to an actual release. Are you building from source, or using a launcher build?

I see. Thank you. I am using the launcher build. Not building from source.

I have now made this change, however it probably won’t make it out in a build until 4.9.

In the meantime, would you be able to perform some sort of composition rather than having to inherit from ADecalActor? I’m told that ADecalActor itself is very small and could easily be reproduced in your own code, as it only really manages a UDecalComponent instance.