Why does the initial build for source take forever?

why does the initial build for source take forever? It has already taken two days and it’s not even half way

Because Unreal Engine is Massive. Your implied next question is the actual answer, “then why is it so much faster the next time?” You see, it goes back to C++ 101. Back in the old days you had to setup your built tool manually by producing a Make file or typing the massive amount of text out on the command line (which you then ran out of space because the command line only held so many characters before chocking which is why we went to make files). Performing a building in C++ manually is a multi-stage process. Modern IDEs take a lot of the fuss out of it today. The first step compiles .h and .cpp files into obj files by running through the entire code base one by one producing the obj files (object files). Inside the make file you actually had to tell the compiler, take this .h and these .cpp files to make this .obj file. Once the object files are been produced you can then call the linker which links up the object files and produces the final executable or dll or library object of your chosen OS.

Now the magic of obj files. With the OBJ files built the next time you run the compiler it will now check if any of the OBJs are out of date, only creating new OBJs for the files that have been changed. This GREATLY speeds up your build time, especially when you have only changed one file. Now if you hit Rebuild, it will take forever again.

Unreal Engine also adds a 3rd stage onto of Compiling and Linking, the Unreal Build Tool which runs over your code first, and produces secondary .h and .cpp files that include methods to how functionality is exposed to Blueprints and reflection information that allow us to use “Class” objects to instance objects.

nope still slow after 2nd time XD

Well… If you have Iterative Building turned off it may be building everything every time you build from source or the building the engine from source is really just that big. I have not had to build the engine from source since it first launched, and then I realized I did not need it, however it was a fun learning experience. Even with the standard install my own project can take up to 5-10 minutes to build if I have made enough changes, after that though it usually takes seconds.