Go to your PROJECTNAME.Build.cs file, open it and add “RHI” in your PublicDependencyModuleNames list.
When you get that message you should google the class name your error is pointing to and check which module dependecy you need to add to your project.