# Error C4668: 'NDIS\_MINIPORT\_MAJOR\_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

**URL:** <https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584>\
**Category:** C++\
**Tags:** unreal-engine, compile, bug-report, question, CPP\
**Created:** [August 29, 2019, 2:01pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584 "2019-08-29T14:01:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xaymar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaymar](https://forums.unrealengine.com/u/Xaymar)\
**Post date:** [August 29, 2019, 2:01pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/1 "2019-08-29T14:01:50Z")

</div>

When Windows SDK 10.0.18362.0 is installed, the build tools for Unreal Engine 4 automatically pick it, even though the actual code does not seem to be fully compatible with the SDK version. Even if other Windows SDKs are installed, the build tools will always pick the latest one instead of selecting the most compatible one.

Is there any way to actually fix this without just giving up and uninstalling the Windows SDK every time I want to work on Unreal Engine 4 code?

---

<div class="post-metadata">

**Author:** ![Xaymar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaymar](https://forums.unrealengine.com/u/Xaymar)\
**Post date:** [August 29, 2019, 2:35pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/2 "2019-08-29T14:35:25Z")

</div>

As seen [on this help page](https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/BuildConfiguration/index.html), it seems that you can indeed overide the Windows SDK version at configure time. This takes a little bit of knowledge of the build system, but with the following xml file stored in “My Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml” it correctly switched to 10.0.17134.0:

```
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
	<WindowsPlatform>
		<WindowsSdkVersion>10.0.17134.0</WindowsSdkVersion>
	</WindowsPlatform>
</Configuration>

```

This should probably help other people that also ran into this issue and had no luck with a Google search on how to fix it.

---

<div class="post-metadata">

**Author:** ![Xaymar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaymar](https://forums.unrealengine.com/u/Xaymar)\
**Post date:** [August 29, 2019, 2:39pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/3 "2019-08-29T14:39:21Z")

</div>

The default value for WindowsSdkVersion at the moment actually seems to be 10.0.16299.0, which should be automatically selected if installed.

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 22, 2021, 9:14am UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/4 "2021-05-22T09:14:00Z")

</div>

Thanks its been a great help. I have added to the standard override to get Visual Studio 2019 as the default  
  
VisualStudio2019

---

<div class="post-metadata">

**Author:** ![zhsun1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zhsun1](https://forums.unrealengine.com/u/zhsun1)\
**Post date:** [August 12, 2022, 10:14pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/5 "2022-08-12T22:14:18Z")

</div>

Hi, I’m a new user of UE and I want to compile UE4.21 from source (since I need to add a patch to the source code). Currently the latest version Visual Studio is VS2022 and I consistently get the same “NDIS\_MINIPORT\_MAJOR\_VERSION” bug. I’m wondering whether downgrading my Visual Studio to 2019 and also downgrading the Windows SDK will solve this issue? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![L30\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@L30\_Games](https://forums.unrealengine.com/u/L30_Games)\
**Post date:** [March 21, 2025, 2:24pm UTC](https://forums.unrealengine.com/t/error-c4668-ndis-miniport-major-version-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-if-elif/454584/6 "2025-03-21T14:24:29Z")

</div>

Hi, i just want to say how i solved mine.  
I just added these lines of code:

> #ifndef \_\_has\_feature
> 
> #define \_\_has\_feature(x) 0
> 
> #endif

Into a general config file (i added to to the one unreal was pointing the error to) or you can even add it to the header file of the class you are trying to build and then it compiles with no problem.
