Hello, whenever I try to include a standard C++ library in an .hpp or .cpp file, I get the error “cannot open source file”
An example of how I’m importing them is simply:
#include <string>
#include <vector>
Includes such as
#include "Arduino.h"
work just fine. I think my problem is that only the C compiler is being invoked and not the C++ compiler. I’m on Windows so I followed C++ programming with Visual Studio Code and Get Started with C++ and Mingw-w64 in Visual Studio Code including the part where I add the /bin directory to PATH, making sure there are no spaces in it.
Here are the intellisense/compiler settings from c_cpp_properties.json:
"intelliSenseMode": "clang-x64",
"cStandard": "c11",
"cppStandard": "c++11",
"compilerPath": "\"C:/Users/joshb/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe\" -mmcu=atmega328p"
Here is my platformio.ini file:
[env:uno]
platform = atmelavr
board = uno
framework = arduino
monitor_speed = 115200
Any help would be much appreciated.