How can I resolve "Warning 2 warning C4653: compiler option 'Optimizations or debug checks' inconsistent with precompiled header"?

Hello

I use “Coherent UI” plugin for drawing HUD.

When I try to build the project in “DebugGame Editor” mode , I get the following warning:

Warning 2 warning C4653: compiler
option ‘Optimizations (one or more of
/Oawstgp[y]) or debug checks (one or
more of /GZ, /RTCcsu)’ inconsistent
with precompiled header; current
command-line option ignored
…\Plugins\CoherentUI\Source\CoherentUIPlugin\Private\CoherentUIViewListener.cpp
1 1

And the error:

error C2220: warning treated as error

  • no ‘object’ file generated

How can I build the project in “DebugGame Editor” mode? Thank you.

I’m getting the same problem when trying to use a plugin that previously contained UnrealEd references.

When the references existed, the compilation error was regarding unknown types contained within UnrealEd, which makes complete sense.

Without all UnrealEd references removed, the plugin compilation now produces this rather more inscrutable complaint.

Found a solution to the problem.

You can disable PCH for CoherentUI module and then he would compile without warning.

namespace UnrealBuildTool.Rules
{
   public class CoherentUIPlugin : ModuleRules
   {
      public CoherentUIPlugin(TargetInfo Target)
      {
         PCHUsage = PCHUsageMode.NoSharedPCHs;
         ...
      }
   }
}