When I created c++ classes and plug-ins with version 4.22, I didn’t generate PCH files. Why? What is a PCH file? Why is it not generated? How should I generate it manually?
I begged for help in answering questions that had been bothering me for hours.
A PCH is a precompiled header. When you write a C++ program you usually include some headers that allow you to call functions that were written by somebody else and which exist on your machine somewhere. When you compile a program (build a project) the compiler will go through all the source code that you have written and that you have referenced in your header files and turn it from your source code (text files) to binary (executable).
Pre compiled headers were designed to allow you to compile your project faster by having code that you will not change (code in the headers that you do not touch) exist as pre compiled files so, the compiler only needs to compile the small amount of code that you have written and not bother itself with a load of code that has not been changed and so does not need to be re-compiled.
This page might or might not help you:-
Thank you very much. I can understand the reason for this. Besides, please ask me why the amount of code I write at a time is not so large and why the compilation time is so long.
How long is ‘so long’? A couple of minutes to compile or build is normal for me when I make a small change in my code. I have a very ordinary machine (2.4GHz, 4 core processor & 16 Gb DDR3 memory. You can try watching your cpu usage using task manager- performance to see if your processor is running as fast as it can and your memory usage. Also, is your hard disk light always on when compiling? - a slow hard disk can be a bottleneck. Maybe you need a faster (ssd) one? But, my hard disk is old and slow and does not give me a big problem. Except when I compiled the engine from source code which took me 2 hours. Made my processor overheat because of dust on it. I had to clean it off to stop my machine crashing. It worked in the end though.
I do not know everything that the Unreal build tool does during the compile but it is more complex than a simple compile of an executable. It must integrate your code with the editor too. I have yet to read a detailed description of how the build tool works.