Unresolved inclusion of standard library headers in Eclipse

Improbabilities
Posts: 3
Joined: Mon Jun 25, 2018 9:58 pm

Unresolved inclusion of standard library headers in Eclipse

Postby Improbabilities » Mon Jun 25, 2018 10:14 pm

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Unresolved inclusion of standard library headers in Eclipse

Postby ESP_Angus » Mon Jun 25, 2018 11:20 pm

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

Improbabilities
Posts: 3
Joined: Mon Jun 25, 2018 9:58 pm

Re: Unresolved inclusion of standard library headers in Eclipse

Postby Improbabilities » Mon Jun 25, 2018 11:33 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Unresolved inclusion of standard library headers in Eclipse

Postby ESP_Angus » Tue Jun 26, 2018 12:03 am

I'll spin up a fresh Eclipse install today and take a look at this.

Improbabilities
Posts: 3
Joined: Mon Jun 25, 2018 9:58 pm

Re: Unresolved inclusion of standard library headers in Eclipse

Postby Improbabilities » Fri Jun 29, 2018 5:12 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Unresolved inclusion of standard library headers in Eclipse

Postby ESP_Angus » Mon Jul 02, 2018 1:07 am

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.

mikemoy
Posts: 627
Joined: Fri Jan 12, 2018 9:10 pm

Re: Unresolved inclusion of standard library headers in Eclipse

Postby mikemoy » Mon Jul 02, 2018 8:06 am

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.

Who is online

Users browsing this forum: Baidu [Spider] and 136 guests