EngineUtils.h breaks compilation

Hello !
I have a C++ project working fine. If I include EngineUtils.h into my GameMode.cpp it simply breaks the build/compilation. I do not use anything from that header just simply includeing it in one line:

#include “EngineUtils.h”

The compile error below… How the inclusion of a hearder file can break the build ???
Thanks for any hint,
G

Info Performing 2 actions (4 in parallel)

Info SD5GameMode.cpp
Error C:\Program Files\Epic Games\4.7\Engine\Source\Runtime/Engine/Public/PixelFormat.h(66) : error C2059: syntax error : ‘constant’

Error C:\Program Files\Epic Games\4.7\Engine\Source\Runtime/Engine/Public/PixelFormat.h(66) : error C3805: ‘constant’: unexpected token, expected either ‘}’ or a ‘,’

Error C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Engine\Public\EngineUtils.h(576) : error C2061: syntax error : identifier ‘FViewport’

Info -------- End Detailed Actions Stats -----------------------------------------------------------

Info ERROR: UBT ERROR: Failed to produce item: C:\Users\Gergely\Documents\Unreal Projects\SD5\Binaries\Win64\UE4Editor-SD5-3847.dll

Info Cumulative action seconds (8 processors): 0,00 building projects, 2,28 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other

Info UBT execution time: 9,74 seconds

Try rebuilding the solution project. This may be an issue of your solution project using header files for a different version of UE4 that you have.

Hi !
Thanks for the answer, but I don’t think this is the issue. I’ve created the project/solution just before with the same version of UE4 (I have only one version installed). Anyway clean/rebuild did not help. Thanks. G

Hmmm, take a peak at your C:\Program Files\Epic Games\4.7\Engine\Source\Runtime/Engine/Public/PixelFormat.h :: 66. Why is there a ‘constant’ there?

As for the EngineUtil.h error, ensure your Project.Build.cs, is including ‘Engine’, (if that files, try core and coreUobject) e.g.:
using UnrealBuildTool;

public class YOURPROJECT : ModuleRules
{
	public YOURPROJECT(TargetInfo Target)
	{
...
		
				
		PublicDependencyModuleNames.AddRange(
			new string[] {
				"Core",
				"CoreUObject", 
				"Engine", 
			}
		);
	}
}