Change (use older) c++ version in Visual Studio [duplicate]

雨燕双飞 提交于 2020-12-29 11:59:45

问题


Is it possible to use an older version in Visual Studio than c++11? A similar question revealed that it is not possible to use a newer version, but I want the compiler to complain when I am using language features that are only available for c++11.


回答1:


To completely disable C++11 features in Visual Studio, you must compile with a toolset old enough that it does not have any C++11 features. The last version of Visual Studio to have no C++11 support was VS2008 (question about that here: Visual Studio 2008 with c++11).

To use an older toolset, you must first install that version of Visual Studio, and then modify the "Configuration Properties->General->Platform Toolset" and set it to the appropriate Visual Studio version. When you compile with Visual Studio 2008 toolset, any C++11 usage will be errors.




回答2:


No, there is no way to disable C++11 features for a Visual Studio project without installing an older MSVC version.



来源:https://stackoverflow.com/questions/30371985/change-use-older-c-version-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!