All source files in module "InputCore" must include the same precompiled header first

Trying to build my game on Linux, I get the same error building on ubuntu 16 lts and manjaro:

Using clang version '5.0.1' (string), 5 (major), 0 (minor), 1 (patch)
@progress push 5%
@progress 'Generating code...' 0%
ERROR: All source files in module "InputCore" must include the same precompiled header first.  Currently "/home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Public/InputCore.h" is included by most of the source files.  The following source files are not including "/home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Public/InputCore.h" as their first include:
       
       /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Private/InputCoreModule.cpp (including /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Public/InputCoreModule.h)
       /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Private/InputCoreTypes.cpp (including /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Classes/InputCoreTypes.h)
       /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Private/GenericPlatform/GenericPlatformInput.cpp (including /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Public/GenericPlatform/GenericPlatformInput.h)
       /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Private/Linux/LinuxPlatformInput.cpp (including /home//Projects/DogFight/Build/UnrealEngine/Engine/Source/Runtime/InputCore/Public/Linux/LinuxPlatformInput.h)
       
       
       To compile this module without implicit precompiled headers, add "PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;" to InputCore.build.cs.
LogModuleManager: Display: Found up-to-date module file ../../../Engine/Plugins/Developer/NullSourceCodeAccess/Binaries/Linux/libUE4Editor-NullSourceCodeAccess.so (API version 0).

How are you building it? Is there a particular command or are you building it from the GUI? What version of the Engine? I know you probably just managed to compile the Engine under linux, as you already do have a project I assume you created it under different OS, does the game cook ok there?

I’ve just built the engine under Linux. I’m putting my project from 4.11 to 4.18. i just go to open my uproject in ue4editor and it asks to build my game which i say yes too, this is when the error is encountered.

So i have had it working in 4.11 on ask platforms previously.

First of you can reply directly to a comment(by clicking reply on the bottom right of it), that way you do not keep on creating answers.

Second, there are a lot of issues doing such a big upgrade. Most significant would be the changes to the *Target.cs files in Source directory. I know there is a wiki page on how to upgrade it somewhere, but I cannot find it at the moment. What I would do is create a new project, check how different they are and fix those.

Furthermore I personally had a lot of issues by going to 4.18 alone, if I were you I would go to 4.17 first(yay more compilation), but this is in case where the *Target.cs does not help. Worst case I would go version by version.

How big is your original project? If it is something that can be easily recreated it might be easiest taking your assets and recreating the c++/blueprint code.

P.S.: Is your code BP only or c++?

Thanks, those tips should help me. I have C++ and blueprint. Its a fairly small project.

Turns out the problem was I was building UE4 inside my project directory, I had to move it outside my project directory and the problem went away!