0

I have a C++ project in Visual Studio 2019. Preferences are set to support C++14 (at least that is my understanding).

Here's my preference panel:
enter image description here

But here's a pic of some of my source with the cursor hovering over the word "__cplusplus":
enter image description here

And yes, I have tried adding the "L" so that my compiler directive refers to "201400L" but that didn't make any difference. How can I get VS to compile C++14?

Logicrat
  • 4,438
  • 16
  • 22
  • Visual Studio projects have different properties for different configurations. You may be only editing one of those configurations and using a different one to compile the code. Make sure to change the two drop boxes in the properties window to "All Configurations" and "All Platforms". – François Andrieux Aug 29 '22 at 18:49
  • Does https://stackoverflow.com/a/46759740/451600 help your situation? – Captain Giraffe Aug 29 '22 at 18:50
  • @FrançoisAndrieux I'm working strictly with the Debug version at the moment, and usually select "All Configurations" when I'm manipulating file properties. – Logicrat Aug 29 '22 at 18:55
  • @CaptainGiraffe Thanks but no, I want C++14, not C++17. – Logicrat Aug 29 '22 at 18:58

1 Answers1

1

You need to enable /Zc:__cplusplus.

Blindy
  • 65,249
  • 10
  • 91
  • 131
  • 1
    Just to be clear however, "How can I get VS to compile C++14?" -- it already is. It's just the macro that's not getting updated. – Blindy Aug 29 '22 at 18:49