Upgrading Visual Studio to 17.12.3 Breaks Unreal.

Hi all,

I am currently running 5.4 and I upgraded Visual Studio from 17.11.1 to 17.12.3. After the update, I could no longer compile my solutoin even though the only thing that had changed was the version of VS. I kept getting these errors:

C4668 ‘__has_feature’ is not defined as a preprocessor macro, replacing ‘0’ with ‘#if/#elif

C4067 Unexpected tokens following preprocessor directive - expected a newline

To solve this, I simply rolled back from 17.12.3 to 17.11.1, but at some point I will have to upgrade. Has anyone else experienced this with the latest version of VS?

Why? The officially recommended VS 2022 version for UE 5.4 (your preferred engine version) is 17.8.

Not the same warnings but I and many others have also experienced some NuGet related issues when using VS 2022 17.12 with UE 5.4.

1 Like

I faced a similar issue, so what I did was add this code at the top of my main header file, and Visual Studio started compiling again.

Add this code at the very top of your main header file:
<<YourProjectFolder>>/Source/<<YourProjectName>>/<<YourProjectName>>.h

#ifndef __has_feature
  #define __has_feature(x) 0
#endif