Set Visual Studio Intellisense C++ Version

Hi, I’m using Visual Studio for IDE with this guide: Visual Studio — PlatformIO latest documentation

I’d like to use C++17, and already have my platform.ini setup to do so, but I’m unable to find a way to get Visual Studio’s intellisense to switch to C++17 mode. I’ve tried adding /std:c++17 to project properties → nmake → additional options, but that didn’t do anything. Anyone have any ideas?

First and foremost you have to tell PlatformIO what C++ version you want to use.

Depending on the currenty used compiler, it might be C++17 capable or not. We need to see your whole platformio.ini first in order to help.

Then the changes done in the platformio.ini should carry over into Visual Studio.

Hi, thanks for chiming in. Here’s my platformio.ini:

; PlatformIO Project Configuration File

;

;   Build options: build flags, source filter

;   Upload options: custom upload port, speed and extra flags

;   Library options: dependencies, extra library storages

;   Advanced options: extra scripting

;

; Please visit documentation for the other options and examples

; https://docs.platformio.org/page/projectconf.html

[env:nodemcuv2]

platform = espressif8266

board = nodemcuv2

framework = arduino

lib_deps = arkhipenko/TaskScheduler@^3.4.0

build_flags = -std=c++17

build_unflags = -std=c++11

[platformio]

This is not necessary in the latest Arduino core version 3.2.0, it already uses -std=gnu++17. You should remove it.

Visual Studio intellisense does not work properly per Visual Studio — PlatformIO latest documentation. However, the code still compiles when using C++17 features.

I’ve opened issue Visual Studio IntelliSense does not recognize basic using std::xyz statements · Issue #4097 · platformio/platformio-core · GitHub in regards to this.