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
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 https://code.visualstudio.com/docs/languages/cpp and https://code.visualstudio.com/docs/cpp/config-mingw 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.