简体   繁体   中英

/Za compiler directive does not compile system headers in VS2010

I wanted to disable language extensions to be able to do some tests in my project. I found that I must set /Za compiler directive from http://msdn.microsoft.com/en-us/library/0k0w269d.aspx , but after this I have errors if I include windows headers. Is there a way to write standard compliant code(enforced by the compiler, not by other programmers/code reviews) in VS2010 and still use system headers?

Thanks you!

<windows.h>使用隔离到不使用/Za编译的源文件中,并在其他文件上使用该参数。

The windows headers have never compiled with /Za.

There are other problems as well with /Za, that has caused Microsoft to stop testing their C++ standard library with that option. As told here:

http://permalink.gmane.org/gmane.comp.lib.boost.devel/212180

The recommendation is not to use it in "real" code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM