setting c++ std to c++98 ?

I tried changing the c++ version to c++98 on the msvc compiler
by using the /std:c++98 option

but it said it was unrecognized ?
i also tried setting it to c++11 but the same thing happened.

It works fine when i set it to c++14, though.

Is this because the compiler simply don't support c++98 ?
or does the newer versions of visual studio just not come with older versions of the standard ?

Last edited on
/std: only works for c++14 or c++latest (and c++17 in latest VS2017).
http://www.pickinpatchfarm.com/en-us/library/mt490614.aspx

As far as I know, Microsoft never allowed switches like c++11, it just gradually added more C++0x (which became c++11) features to its compiler, without having the option of turning them off.

quote from December 2013:
http://www.pickinpatchfarm.com/Forums/en-US/8c2797a2-64d8-42fc-bb1a-33e8e6209989/visual-studio-supporting-c11how-to-enable-c11?forum=vcgeneral

You don't have to do anything special to enable [C++11] features.
Marked as answer by Jane Wang - MSFTMicrosoft contingent staff


_______________________________________

The solution on StackOverflow seems to be that you simply have to use an earlier toolset...
http://www.pickinpatchfarm.com/questions/30371985/change-use-older-c-version-in-visual-studio

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.
Last edited on
What version of the compiler are you using? The /std:c++14 option was added to the VS 2015 with update 3. To allow you to stick with the C++14 standard while they modify their compiler to support the upcoming C++17 standard.

Normally VS doesn't support going backwards to get something like strict C++98 support. If you want something to compile to C++98 you would need to download a compiler that doesn't yet support C++11 features, VS 2008. You'll have the same problems if you need to support strict C++11, you'll need to find a compiler that doesn't support any C++14 features, good luck on this. The different versions of the compiler will support different features of the standards and finding one with all of the C++11 features without any C++14 features may not be possible.

You need to realize that when a new standard is released the older standard is depreciated. So as of now the current C++ standard is C++14, with C++17 in the final release stages. It should get final approval before the end of the year (hopefully).
you'll need to find a compiler that doesn't support any C++14 features, good luck on this.

Indeed, I don't think having full C++11 support without any C++14 features is possible for Microsoft compilers.
Comparing the C++11 and C++14 features in http://www.pickinpatchfarm.com/w/cpp/compiler_support supports this claim. (18.0 seems to be closest you'll get to full C++11 support without going over, but that leaves out things like constexpr)

A company that wants a strict policy would need to use the /std:c++14 switch... or just make sure all employees are using a close-enough compiler version and have a proper build system.
Registered users can post here. Sign in or register to post.
<blockquote id="pwjBlLZ"><tr id="pwjBlLZ"></tr></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect><blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"></mark>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<nav id="pwjBlLZ"><tr id="pwjBlLZ"><address id="pwjBlLZ"></address></tr></nav>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"><tr id="pwjBlLZ"></tr></mark>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
  • 629832435 2018-04-20
  • 4254782434 2018-04-20
  • 7642392433 2018-04-20
  • 4201592432 2018-04-20
  • 1221362431 2018-04-20
  • 5455692430 2018-04-20
  • 8345962429 2018-04-20
  • 7297372428 2018-04-20
  • 4929522427 2018-04-20
  • 1938132426 2018-04-20
  • 2267862425 2018-04-20
  • 6177082424 2018-04-20
  • 838232423 2018-04-20
  • 4694502422 2018-04-20
  • 6512882421 2018-04-19
  • 4659652420 2018-04-19
  • 2967832419 2018-04-19
  • 8339042418 2018-04-19
  • 8147112417 2018-04-19
  • 2774752416 2018-04-19