VS2010 C和C ++ - 强制执行符合Linux / gcc兼容性的ANSI标准? [英] VS2010 C and C++ - enforce ANSI compliance for Linux/gcc compatibility?
问题描述
我正在上一门课,我需要为Linux编写一些C ++应用程序。我真的很不喜欢Linux下可用的开发工具,但我喜欢VS2010。
是否有任何类型的编译器开关可以在VC ++中强制执行ANSI或gcc兼容性?或者我可以将编译器替换为gcc并仍然使用VS环境?
您可以禁用Microsoft扩展到ANSI C和ANSI C ++标准,通过指定 / Za
标志,如果您使用非标准的C和C ++功能,将会使编译器发出错误。
http:// msdn.microsoft.com/en-us/library/0k0w269d(v=VS.100).aspx
然而,这并不排除你从使用特定于平台的头文件。
I'm taking a class in which I'm required to write some C++ apps for Linux. I really, really dislike the dev tools available under Linux, but I love VS2010.
Is there any sort of compiler switch which will enforce ANSI or gcc compatibility in VC++? Or can I swap the compiler out for gcc and still use the VS environment?
You can disable Microsoft extensions to the ANSI C and ANSI C++ standards by specifying the /Za
flag, which will make the compiler emit errors if you use non-standard C and C++ features.
http://msdn.microsoft.com/en-us/library/0k0w269d(v=VS.100).aspx
However, this doesn't preclude you from using platform specific headers.
这篇关于VS2010 C和C ++ - 强制执行符合Linux / gcc兼容性的ANSI标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!