Dependency modules & identifier errors

I am developing a plugin for Unreal Engine but when I include “PostProcess/PostProcessing.h” in an empty header that is not included by any other files except its also empty associated .cpp I get multiple C2061 errors (and other identifier errors like C4430, C4183, etc.) like this:

error C2061: syntax error : identifier 'EPassOutputId'	c:\program files\epic games\4.8\engine\source\runtime\renderer\private\postprocess\RenderingCompositionGraph.h	76	1

I believe the problem is that I need to add a dependency module (Core, Engine, RHI, etc.) in my .Build.cs but they don’t seem to be documented at all, thus making it pretty hard to find.


The question: Which module is required ? (Unless I’m wrong and it is something else, then solutions to those errors are welcome)

Short answer: I believe the module you’re looking for is Renderer.

Detailed answer:
Usually I would search the type I am getting an error for in the documentation and at the very bottom of the doc it says which module it is apart of. However, EPassOutputId's doc page seems to be broken (broken doc link.)

Even if you have a broken link the module name is in the URL of the doc. Take the broken link above for example.

[docs.unrealengine.com/latest/INT/API/Runtime/ Renderer /EPassOutputId/index.html][2]

You can also see what module it is apart of (generally) from the error message. Just look for the folder it’s within. That is usually the module name.

c:\program files\epic games\4.8\engine\source\runtime\ renderer \private\postprocess\RenderingCompositionGraph.h

Hope this helps you, and don’t forget to regenerate your project files once you’ve added a dependency!

Edit: Here’s a gif of finding the module for AActor. This should work for any type. I personally would prefer it if Epic put the module and the header file at the top of the doc so you can easily find it.

49709-aactor-doc-search.gif

Thank you for your explanation on modules. Sadly, adding Renderer did not fix the errors. I added it to my plugin’s .Build.cs with this:

PrivateDependencyModuleNames.AddRange(new string[] {"Core", "Engine", "RHI", "Renderer", "ShaderCore" });

then deleted the Intermediate folder to be sure (some files did not seem to be regenerated) and then did Generate Visual Studio project files in the .uproject context menu but I still get the same errors. I also checked which modules were required and it seemed to be only Engine and Renderer.

Hmmm I just tried it on my own project. I added “Renderer” to my private dependencies, included PostProcessParameters.h and made a function that uses EPassOutputId and called it with no errors. Maybe there is something else missing here. Mind editing your post and adding some extra code relative to the error?

There is no code really, everything is commented, there is only the header guards and #include "PostProcess/PostProcessing.h". Just for the hell of it I tried including PostProcessParameters.h before including PostProcessing.h to give the latter an indirect include and most errors went away. I then also included GlobalShader.h and there’s only one odd error left: Error 1 error C2664: 'void FGlobalShader::SetParameters<FVertexShaderRHIParamRef>(FRHICommandList &,const ShaderRHIParamRef,const FSceneView &)' : cannot convert argument 3 from 'FViewInfo' to 'const FSceneView &' c:\program files\epic games\4.8\engine\source\runtime\renderer\private\postprocess\PostProcessing.h 46 1. Those includes are not a good solution though.

That error is saying FGlobalShader::SetParameters is being called with an incorrect argument. Are you calling it anywhere?