# Compile error: '\_\_faststorefence': is not a member of 'FWindowsPlatformMisc'

**URL:** <https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260>\
**Category:** C++\
**Tags:** unreal-engine, question, CPP\
**Created:** [September 23, 2017, 8:38am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260 "2017-09-23T08:38:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_24cff47d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_24cff47d](https://forums.unrealengine.com/u/anonymous_user_24cff47d)\
**Post date:** [September 23, 2017, 8:38am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/1 "2017-09-23T08:38:51Z")

</div>

I get below compile error in DebugGame but not in DebugGame\_Editor. There is no other information so any insights would be appreciated.

```
2>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Async/AsyncFileHandle.h(101): error C2039: '__faststorefence': is not a member of 'FWindowsPlatformMisc'
2> c:\program files\epic games\ue_4.16\engine\source\runtime\core\public\Windows/WindowsPlatformMisc.h(35): note: see declaration of 'FWindowsPlatformMisc'
2>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Async/AsyncFileHandle.h(151): error C2039: '__faststorefence': is not a member of 'FWindowsPlatformMisc'
2> c:\program files\epic games\ue_4.16\engine\source\runtime\core\public\Windows/WindowsPlatformMisc.h(35): note: see declaration of 'FWindowsPlatformMisc'
2>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Async/AsyncFileHandle.h(156): error C2039: '__faststorefence': is not a member of 'FWindowsPlatformMisc'
2> c:\program files\epic games\ue_4.16\engine\source\runtime\core\public\Windows/WindowsPlatformMisc.h(35): note: see declaration of 'FWindowsPlatformMisc'
2>C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Async/AsyncFileHandle.h(162): error C2039: '__faststorefence': is not a member of 'FWindowsPlatformMisc'
2> c:\program files\epic games\ue_4.16\engine\source\runtime\core\public\Windows/WindowsPlatformMisc.h(35): note: see declaration of 'FWindowsPlatformMisc'

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_24cff47d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_24cff47d](https://forums.unrealengine.com/u/anonymous_user_24cff47d)\
**Post date:** [September 26, 2017, 5:44am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/2 "2017-09-26T05:44:19Z")

</div>

Any responses? This is coming from engine source and likely a bug…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ff281d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ff281d1](https://forums.unrealengine.com/u/anonymous_user_8ff281d1)\
**Post date:** [August 30, 2018, 8:44am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/3 "2018-08-30T08:44:29Z")

</div>

Your code had include “windows.h” in the beginning of the .h file ? I have the same problems, just put “windows.h” after UE header files, or move “windows.h” from common .h file. By this,I solve this problem.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ff281d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ff281d1](https://forums.unrealengine.com/u/anonymous_user_8ff281d1)\
**Post date:** [August 30, 2018, 8:44am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/4 "2018-08-30T08:44:48Z")

</div>

Your code had include “windows.h” in the beginning of the .h file ? I have the same problems, just put “windows.h” after UE header files, or move “windows.h” from common .h file. By this,I solve this problem.

---

<div class="post-metadata">

**Author:** ![flashASA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@flashASA](https://forums.unrealengine.com/u/flashASA)\
**Post date:** [October 19, 2018, 9:44am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/5 "2018-10-19T09:44:32Z")

</div>

At [this topic](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/113028-getting-build-error-in-my-engine-plugin-while-building-in-ue4-editor-while-packaging-the-project?140208-Getting-build-error-in-my-engine-plugin-while-building-in-UE4-editor-while-packaging-the-project=)

I found a solution for plugin coding: changing Plugin type from Runtime to Developer.

---

<div class="post-metadata">

**Author:** ![Kmack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmack/32/706181_2.png) [@Kmack](https://forums.unrealengine.com/u/Kmack)\
**Post date:** [October 12, 2021, 1:01am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/6 "2021-10-12T01:01:57Z")

</div>

I know I’m necro-ing an old thread here but the existing answers on this aren’t exactly correct.

What’s going on here is the windows.h include is defining one or more types that conflict with later definitions within unreal.  
You can fix this by surrounding it with PreWindowsApi.h and PostWindowsApi.h includes that define things Windows will expect, and then undefine things that will conflict with Unreal:

```
#if PLATFORM_WINDOWS
THIRD_PARTY_INCLUDES_START
#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/PreWindowsApi.h"

#include Windows.h

#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"
THIRD_PARTY_INCLUDES_END
#endif

```

This will ensure that things are set up correctly for the Windows include, and then properly cleaned up to allow Unreal to get on with its work.

Let’s say, however, that the Windows.h include is inside another library that you can’t easily change - you can wrap it something like this:

```
#if PLATFORM_WINDOWS
// Foo libraries include Windows headers. Use these includes and the end includes below to ensure that windows header includes don't conflict with Unreal definitions.
THIRD_PARTY_INCLUDES_START
#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/PreWindowsApi.h"
#endif

#include "FooLibrary/Foo.h"
#include "FooLibrary/Bar.h"

#if PLATFORM_WINDOWS
#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"
THIRD_PARTY_INCLUDES_END
#endif
```

---

<div class="post-metadata">

**Author:** ![Rumzie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rumzie](https://forums.unrealengine.com/u/Rumzie)\
**Post date:** [March 17, 2023, 2:47am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/7 "2023-03-17T02:47:18Z")

</div>

I can’t believe how solid of an answer this is. Thank you!

---

<div class="post-metadata">

**Author:** ![kalmiya](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalmiya](https://forums.unrealengine.com/u/kalmiya)\
**Post date:** [July 26, 2023, 12:20pm UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/8 "2023-07-26T12:20:01Z")

</div>

Thank you for this valuable nugget of information!

---

<div class="post-metadata">

**Author:** ![Nathanmiguel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nathanmiguel/32/1001711_2.png) [@Nathanmiguel](https://forums.unrealengine.com/u/Nathanmiguel)\
**Post date:** [November 27, 2024, 2:03am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/9 "2024-11-27T02:03:55Z")

</div>

Hello, I am finalizing the integration of the standalone/non-Boost Asio as a plugin in Unreal. I am encountering the same error when I try to package the plugin. Could you please help me on my forum?

[Here is the link](https://forums.unrealengine.com/t/error-c2039-faststorefence-is-not-a-member-of-fwindowsplatformmisc-asio-for-unreal/2152339)

---

<div class="post-metadata">

**Author:** ![Morton\_Sykes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Morton\_Sykes](https://forums.unrealengine.com/u/Morton_Sykes)\
**Post date:** [April 9, 2026, 11:16am UTC](https://forums.unrealengine.com/t/compile-error-faststorefence-is-not-a-member-of-fwindowsplatformmisc/405260/10 "2026-04-09T11:16:01Z")

</div>

Thanks! This advice helped solved my problem too!

My case looked something like this:

#include “Windows/AllowWindowsPlatformTypes.h”  
#include “Windows/PreWindowsApi.h”

#include \<windows.h\>

….  
BOOL RetValue = TRUE;  
return RetValue ;

#include “Windows/PostWindowsApi.h”  
#include “Windows/HideWindowsPlatformTypes.h”
