# Very long c++ compiling

**URL:** <https://forums.unrealengine.com/t/very-long-c-compiling/484394>\
**Category:** Platform & Builds\
**Tags:** compiling, engine-compile, unreal-engine, compile, slow, question, compile-editor\
**Created:** [June 4, 2021, 12:24am UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394 "2021-06-04T00:24:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0202af0f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0202af0f1](https://forums.unrealengine.com/u/anonymous_user_0202af0f1)\
**Post date:** [June 4, 2021, 12:24am UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394/1 "2021-06-04T00:24:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Blockout22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Blockout22](https://forums.unrealengine.com/u/Blockout22)\
**Post date:** [June 4, 2021, 2:20am UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394/2 "2021-06-04T02:20:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gida](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gida/32/1168064_2.png) [@gida](https://forums.unrealengine.com/u/gida)\
**Post date:** [June 4, 2021, 9:57am UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394/3 "2021-06-04T09:57:29Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [June 4, 2021, 11:42am UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394/4 "2021-06-04T11:42:43Z")

</div>

Several ways you could try :

- Dont include libraries in header files. Use `class` prefix instead

- Add Build.cs file below code parts.

and please share the result.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0202af0f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0202af0f1](https://forums.unrealengine.com/u/anonymous_user_0202af0f1)\
**Post date:** [June 4, 2021, 12:56pm UTC](https://forums.unrealengine.com/t/very-long-c-compiling/484394/5 "2021-06-04T12:56:47Z")

</div>

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