I am trying to create a project in Microsoft Visual C ++ 2013 by disabling all non-standard extensions.
#ifdef _MSC_VER #include <windows.h> #endif
In the configuration properties → C / C ++ → Language, I set the “Prohibit language extensions” to “Yes” (/ Za).
However, while creating the previous code, I get errors such as:
C: \ Program Files (x86) \ Windows Kits \ 8.1 \ Include \ um \ winnt.h (11527): error C2467: illegal declaration of an anonymous structure
This means that the _MSC_VER macro is still defined and "windows.h" is enabled.
How to include a file if and only if I use Visual C ++?
How can I install Visual C ++ so that it compiles the code as standard C ++, marking all Microsoft extensions as errors?
source share