Page 1 of 1
Unresolved inclusion of standard library headers in Eclipse
Posted: Mon Jun 25, 2018 10:14 pm
by Improbabilities
I'm trying to use the utility.h header from the standard template library in a c++ project but eclipse will not compile as it complains that it cannot find the header file.
I'm using windows, and followed the most recent instructions for setting up eclipse for use with the esp-idf and have been able to build and modify the included hello_world template. Eclipse seems to be able to find the utility header somehow because it shows it in one of the folders in the Includes drop down in the project explorer, even though I have not manually set any include paths. It's still giving me errors though, and refuses to build.
The included headers from the example seem to be coming from another location entirely, but this path does not have the complete set of header files from the c++ standard library. Has anyone encountered this error before, or know of anything which might help resolve it?
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Mon Jun 25, 2018 11:20 pm
by ESP_Angus
Hi Improbabilities,
Thanks for mentioning this again. There is a bug in the Build Output parser regular expression set for Eclipse, which means it doesn't properly evaluate headers for C++ files.
It was
reported on Github here, and in a comment I (@projectgus) suggest another regex which should work, but the original poster hasn't confirmed the fix and I haven't had a chance to test it either:
If you try the alternative regular expression mentioned here, does it find all the headers correctly? (You may need to do Project -> C/C++ Index -> Rebuild and then build the project again before it updates.)
Angus
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Mon Jun 25, 2018 11:33 pm
by Improbabilities
No luck unfortunately, probably just going to give up on this as it would be less work to rewrite the functions i need at this point. For what it's worth, I'm pretty novice at c/c++ and have never used Eclipse before, so I can't rule out the possibility that something else is setup wrong.
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Tue Jun 26, 2018 12:03 am
by ESP_Angus
I'll spin up a fresh Eclipse install today and take a look at this.
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Fri Jun 29, 2018 5:12 pm
by Improbabilities
For anyone who comes across this looking for a solution to the same problem, I've decided to switch to Visual Studio code as an IDE instead of Eclipse with great success. A useful setup guide can be found
here. I guess it's more of a workaround, but I've been much happier with VS code than eclipse.
Thanks for looking into the issues with Eclipse on Windows, and please consider adding a setup guide for VS code to the official IDF documentation.
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Mon Jul 02, 2018 1:07 am
by ESP_Angus
Improbabilities wrote:For anyone who comes across this looking for a solution to the same problem, I've decided to switch to Visual Studio code as an IDE instead of Eclipse with great success. A useful setup guide can be found
here. I guess it's more of a workaround, but I've been much happier with VS code than eclipse.
Glad you found a workaround. Last week we updated the Eclipse setup guides (
Windows /
other OSes). There were a couple of small clarifications added as well as the regex. Following these instructions on a clean Windows VM I was able to get both .c and .cpp files resolving all headers after an initial build, but it's easy to miss a step and then things won't resolve correctly.
Improbabilities wrote:Thanks for looking into the issues with Eclipse on Windows, and please consider adding a setup guide for VS code to the official IDF documentation.
We are looking at both VS Code, and also much simpler and less fiddly Eclipse setup steps, as part of the
cmake-based build system.
Re: Unresolved inclusion of standard library headers in Eclipse
Posted: Mon Jul 02, 2018 8:06 am
by mikemoy
A useful setup guide can be found here. I guess it's more of a workaround, but I've been much happier with VS code than eclipse.
There is a video
here that expands the functionality of VS from that link.