However, I get compile errors from STL header files in these directories:
C++
1
2
Error attributes should be specified before the declarator inafunctiondefinition HelloWorldC:\SysGCC\esp32\opt\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\backward\binders.h63
Error attributes should be specified before the declarator inafunctiondefinition HelloWorldC:\SysGCC\esp32\opt\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\bits\allocator.h52
There are a lot more errors but they are related to referencing the STL
Please double-check that you are not trying to include STL headers from .h files that are included from plain C files.
If it doesn’t help, please follow the steps on this page to narrow it down to a specific step triggering the problem and we will try to help you. That said, it might be a limitation of the ESP32 toolchain, so it could be worthwhile to check with Espressif whether it’s a known problem.