Errors displayed in Espressif-IDE when including standard C++ libraries

imaple
Posts: 1
Joined: Fri Sep 13, 2024 4:14 pm

Errors displayed in Espressif-IDE when including standard C++ libraries

Postby imaple » Fri Sep 13, 2024 4:22 pm

In our ESP32-C3 project we have a mix of C and C++ code. Naturally we would like to use standard C++ libraries, like <string>, <vector> etc.

Adding these with #include immediately marks it as an error. Same goes for c* libraries like <cstring>, statements "using namespace std;" and other. Basic operators like calling a method from an object e.g. myobj.dosomething(); are marked as errors too, because IDE considers myobj an integer due to std::vector used as class member. Furthermore, all .cpp files that include the one with an error are also marked, creating a chain reaction that paints pretty much entire project in red.

The code itself compiles and runs OK, so ESP-IDF is fine. It is only an editor in IDE or whatever code analyzer is running in it gives us headache and slows down development a lot. It is very weird, since it recognizes the rest of C++ code just fine and supports helpful features like ctrl-click jump to the class sources.

Is there any way to make IDE recognize standard C++ libraries?

Eclipse plugin version 3.0, IDF version 5.3

Who is online

Users browsing this forum: NoTan2 and 6 guests