How to enable C++98 compiling in Visual Studio 2019? because I want to compile an old project and the old project need a c++ 98 environment.
-
try this [question](https://stackoverflow.com/questions/30371985/change-use-older-c-version-in-visual-studio) – vsh Dec 23 '19 at 03:32
-
https://stackoverflow.com/a/23386938/2864740 – user2864740 Dec 23 '19 at 03:42
-
Project > Properties > C/C++ > Language > Conformance mode = No. – Hans Passant Dec 23 '19 at 11:52
1 Answers
In short: The compiler does not support standards switches for C++98, C++03, or C++11.Link
each compiler support default C++ version:
C++98 (ISO/IEC 14882:1998) is the first edition.
C++03 (ISO/IEC 14882:2003) is the second edition.
C++11 is the third edition.
C++14 is the fourth edition. (min version for Visual Studio 2019)
C++17 is the fifth edition.
You can 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.
To find the right version for your code: Microsoft C++ language conformance table
Alternatively, install some recent GCC variant - 4.9 or better; or some recent Clang/LLVM (perhaps thru cygwin, mingw, or by installing a Linux distribution). Then compile with g++ -std=c++98 or clang++ -std=c++98.

- 41
- 3