For some reason an error shows up every time I try to compile my code. Currently I am just starting out with arduino and I get this error every time. I tried the simple blinky program
Remove the folder C:\Users\<user>\.platformio\packages\framework-arduino-avr and rebuild. Your package folder probably got corrupted or downloaded incompletely.
There deliberately is no Discord server for PlatformIO because all information / help is intended to be on the publically viewable forum, not burried deep in thousands of lines of discord chat logs. See Is there a support chat channel for platformio?.
Delete the folder again plus C:\Users\<user>\.platformio\.cache, plus C:\Users\<user>\.platformio\platforms\atmelavr. When you rebuild, it should show that it’s re-downloading the platform and framework packages. Does that appear?
You are somehow using an extension that attempts to build the source file locally with the g++ compiler for the local computer. This is completely wrong. You must trigger the firmware build via the project task “Build” (or “Upload” respectively), or via the toolbar through the PlatformIO extension. Not any other other plugin or menu.
Make sure that as installed extensions, you only have C/C++ by Microsoft, PlatformIO, Python and Jupyter. Other C/C++ build extensions will screw with the PlatformIO project.
I forgot to mention but I had completely uninstalled vscode following a stackoverflow tutorial and then reinstalled it because I was facing the issue but the issue didn’t go.
Try deleting the .viscode subfolder at (1), selecting the terminal tab at (2) and try re-building the project. What output is shown on the Terminal tab, even if VScode switches away from it. You should not editing anything in c_cpp_properties.json