I created a DirectX project in visual studio which worked until I changed the version of C++ being used from C++14 to C++20. It gave me this error when I attempted to build cl : command line error D8016: '/ZW' and '/std:c++20' command-line options are incompatible so I changed the settings to use 14 again though it still gave the same error. I know it's not a problem with my code as I didn't change it between this working on not working.
I've tried mess around with the cl settings but that seems to do nothing. When I change the version to C++17 it still has the same problem thinking it's C++20. When I try using latest it will say latest has is incompatible. enter image description here
I've also tried creating a new project to which I would copy the code over however when I try doing the new projects have a completely different bug where VS will close when they are built.
The /ZW
switch is specifically for the C++/CX language extensions used for Windows Runtime APIs typically for UWP applications. As these language extensions have been deprecated in favor of the more modern C++/WinRT language projections the C++/CX extensions are not compatible with a number of modern C++ Standards conformance features.
You have three basic choices here:
This also means if you try to make use of
/permissive-
that you'll need to add/Zc:twoPhase-
.
If you want to target the UWP app platform with C++17 or C++20, switch to using the C++/WinRT language projections instead. You can install the C++/WinRT VSIX to get new templates or you can make use of the C++/WinRT templates from GitHub.
If you want a DirectX template for classic Win32 desktop programming which uses neither C++/CX nor C++/WinRT language projections, you can find them on GitHub. Visual Studio has no built-in "DirectX templates" for classic Win32 desktop development.