# How to skip code when compiling dedicated server?

**URL:** <https://forums.unrealengine.com/t/how-to-skip-code-when-compiling-dedicated-server/2347539>\
**Category:** Getting Started & Setup\
**Tags:** unreal-engine, question\
**Created:** [February 20, 2025, 11:27pm UTC](https://forums.unrealengine.com/t/how-to-skip-code-when-compiling-dedicated-server/2347539 "2025-02-20T23:27:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 21, 2025, 12:01am UTC](https://forums.unrealengine.com/t/how-to-skip-code-when-compiling-dedicated-server/2347539/2 "2025-02-21T00:01:08Z")

</div>

Ok, i found this publication

Seems it let me compile without errors…

```auto
#if !WITH_SERVER_CODE
	Container->ShiftChild(0, Widget);
#endif // WITH_SERVER_CODE

```

I just hope it does not omit the code for listen server

> [@Dedicated server code split from client code](https://forums.unrealengine.com/t/dedicated-server-code-split-from-client-code/7446/2):
>
> The key to this is the Server and Client code configuration. So to build a cooked client that doesn’t have access to dedicated server code you can build “Development Client”, which is almost the same as “Development” but with server-only code disabled. What this does is set the WITH\_SERVER\_CODE define to false. When this is false various things like server-side networking are compiled out in the engine. There is no client-only configuration with editor functionality enabled, so this only works w…

Thank you so much @Ben_Zeigler

* * *

Edited 1:

I don’t understand why only this function generated errors.  
I have many widgets in my project.  
Can someone explain if I really need to skip code?  
I mean… maybe all the widget code is set up to be skipped by default.  
And for some reason they forgot to skip this function → ShiftChild();  
Or should I skip the code even if I don’t get any errors when compiling?

Thank you so much !!

* * *

* * *

Edited 2:

Well… I found the reason for the compilation error.

 ![0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/5/c8580fb5228cf2baace63eab904470e4f3f06534.png)

This isn’t going to work in the shipping version, right? 🤦‍♂️

* * *

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-skip-code-when-compiling-dedicated-server/2347539)._
