# Strange compile error when adding UPROPERTY

**URL:** <https://forums.unrealengine.com/t/strange-compile-error-when-adding-uproperty/120456>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [December 28, 2018, 1:46pm UTC](https://forums.unrealengine.com/t/strange-compile-error-when-adding-uproperty/120456 "2018-12-28T13:46:36Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [January 5, 2019, 2:05am UTC](https://forums.unrealengine.com/t/strange-compile-error-when-adding-uproperty/120456/20 "2019-01-05T02:05:21Z")

</div>

In my experience forward declarations of enums and structs don’t work. The reason it may have worked before is because under the hood UE4 can merge source files before compiling to reduce compile time. This is called “unity build”. The reason why it broke suddenly is then because after small code changes can cause the unity build to combine the files together in a different way. So by chance the unity build took care of an include you were missing, and by chance it stopped doing that after different files were combined.

To disable unity build, go to your project’s MyProject.Target.cs and add to the constructor:

```auto

        bUseUnityBuild = false;

```

Try compiling once in a while with unity build disabled, it may reveal some more missing includes which would have randomly turned up later.

---

_[View the full topic](https://forums.unrealengine.com/t/strange-compile-error-when-adding-uproperty/120456)._
