Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to manage precompiled headers (.gch files)

Hi all,

almost every day I have to practically recompile Unreal when compiling my projects just because of an error like the one below:

fatal error: file '/usr/include/linux/sysctl.h' has been modified since the precompiled header '/path/to/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealLightmass/Development/Core/CorePrivatePCH.h.gch' was built note: please rebuild precompiled header '/path/to/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealLightmass/Development/Core/CorePrivatePCH.h.gch'

I've been doing some tests to reproduce the error and I found that the error is caused in clang++ instead of Unreal (you may know this already).

I saw that the error occurs if a do a single "touch /usr/include/linux/sysctl.h". Of course I don't touch this file or change it. I don't even know when this file gets updated in a computer that I never installed anything after compiling Unreal.

For me, I don't even care when that file changes. I would like to completely ignore it once Unreal Engine is compiled.

Does any of you know whether is possible to do that in Unreal?

I know this may be more clang++ than Unreal related, but I'm asking here because you may have any idea.

Reproducing the error

In case you want to reproduce this error outside of Unreal, you can do the following:

 # Create a file first.h:
 echo "#define version 1" > first.h;
 # Create a second.h file which includes first.h:
 echo '#include "first.h"' > second.h;
 # Create a main file which includes second.h:
 echo -e '#include "second.h"\n int main(){return 0;}' > main.cpp
 # Compile the second.h, generating a second.h.gch:
 clang++ second.h
 # Now let's "change" first.h:
 touch first.h;
 # If we just compile main.cpp, it works:
 clang++ main.cpp 
 # If we compile main.cpp telling clang++ to use the precompiled header, then the error shows up:
 clang++ main.cpp -include second.h

 # Now the error is raised:
 #   fatal error: file '/path/to/first.h' has been modified since the precompiled header 'second.h.gch' was built
 #   note: please rebuild precompiled header 'second.h.gch'
 #   1 error generated.
Product Version: UE 4.20
more ▼

asked Nov 06 '18 at 02:26 PM in C++ Programming

avatar image

Ruben Alves
20 5 10 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question