yhongm
yhongm

Reputation: 91

How to enable C++98 compiling in Visual Studio 2019?

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.

Upvotes: 3

Views: 4592

Answers (1)

Tal Hadar
Tal Hadar

Reputation: 41

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.

Upvotes: 4

Related Questions