Very long c++ compiling

When I try to compile my c++ code in UE5’s early access it takes over 10 minutes, most on the time it’s stuck on “Building x actions with y processes”, but if I compile the same code in UE 4.25 it only takes a few seconds

what might be causing it and how can I fix it?

I could be wrong but with my workspace from just packages the game, usually it only takes a long time the first time it builds but it looks it rebuilds the entire thing again.

maybe that’s what is happing in your code when you compile your c++ code, instead of just compiling your new code it’s probably just compiling it all again

P.S. I haven’t tested so I could be wrong

Hi! The same is happening to me on UE 4.26.
“Building x actions with y processes” takes forever the first time I compile every day.

This is happening to me with Visual Studio, Rider, and even compiling from command line, so I don’t think the IDE is the cause.

The two machines I am testing this with are not extremely powerful, but subsequent compile times are sensibly reduced on both (10-20 mins → less than 1-2 min). Basically, the first thing I do everyday is compile once.

I guess compiling against UE might need a lot of data to be loaded on the RAM. Maybe that’s just what’s happening? I suppose if the OS needs the memory or cleans it up for any reason, I might get that long “Building x actions with y processes” again during the day.

I am actually just guessing, but I am not finding much information about this around!

Several ways you could try :

  • Dont include libraries in header files. Use class prefix instead

  • Add Build.cs file below code parts.

    MinFilesUsingPrecompiledHeaderOverride = 1;

    bFasterWithoutUnity = true;

and please share the result.

it actually is true, thank you! I had two long compiles, but after that everything was much faster