Xtensa-esp32-elf-g++: error: src/main.cpp: No such file or directory

I’ve just followed a tutorial on how to do a HelloWorld application using PlatformIO in VSCode. Unfortunately when I go to build the project I get the following error:

xtensa-esp32-elf-g++: error: src/main.cpp: No such file or directory

I can’t see why, obviously this file is there. I haven’t altered the default new project apart from put the Serial.begin and Serial.println into the code.

What is the path to the project and its platformio.ini? Can we see a full screenshot of VSCode with the error visible?

Sure, the path is C:\Users\Anthony\arduinoCode\HelloWorld, here’s a screenshot:

Can you also show the content of your platformio.ini please?

Sure, it’s just the default with a monitor_speed added: