Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby Zingemneire » Fri Jun 08, 2018 12:26 pm

Hi,

I think I have an odd problem in my project.

Within the project I have lots of ' #include "somefile.h" ' lines which reference various ESP-IDF header files, for example to header file "esp_err.h". From the beginning I have a list of various predefined PATHS and SYMBOLS, when I add a reference to another header file that is not in the existing list I simply add another path to the existing list, rebuild the index and things get sorted.

The exception to the rule is instruction ' #include "cJSON.h" '. Although I have added the path to its location ( see second line in the "includes" tab in "Path and Symbols" in the attached image file ) Eclipse stubbornly lists that one as an "Unresolved inclusion". The +/- 20 or so other ones it happily resolves but not that one.
By the way: the project builds just fine both from within Eclipse or from the command line using command "make -j4"

Anyone out there with an idea as to what might be causing this :?:
Attachments
Paths and Symbols.PNG
Paths and Symbols.PNG (44.75 KiB) Viewed 7864 times

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

Re: Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby Zingemneire » Tue Jun 19, 2018 6:13 am

Hi All,

After trawling the internet for an answer to this one the bottom line appears to be that Eclipse sometimes can't cut it. In spite of setting up everything correctly Eclipse sometimes misses a beat here or there. I have solved this one by putting a copy of the "cJSON.h" file in the directory where I make use of the file in my own JSON handling code. For the build it does not make the slightest difference but Eclipse can now handle the inclusion and continues being able to resolve items mentioned within the file. :o

All for now.

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby Vader_Mester » Tue Jun 19, 2018 6:59 am

Get the same issue over and over and ooooveeeeer again with Eclipse :?

It compiles without issues though :D Although what bugs me with Eclipse is that it is extremely sloooow.
I hope the cmake things better and more compatible with other IDEs.

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby kolban » Tue Jun 19, 2018 5:15 pm

What language is the program being compiled? C or C++?
What does the actual include of "cJSON.h" look like?

For example:

#include <cJSON.h>

or

#include "cJSON.h"
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

Re: Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby Zingemneire » Thu Jun 28, 2018 11:59 am

Hi All,

I have been busy with other things the last week so i did not check the forum for answers for a while.

As to the original problem: I had an additional case of the same. in one of my c files i Had to put in this line.

Code: Select all

#include "esp_err.h"  // extra pointless include to allow Eclipse to resolve ESP_OK and ESP_FAIL
As the file builds perfectly file "esp_err.h" is definitely referenced in another include file somewhere so the compiler does find it but for some reason Eclipse can't find it in this file ( although it does find it in many other cases/files without extra include instructions ). In this particular case I have put in the extra include instruction and left it at that.

@Kolban: it definitely compiles with the c compiler. and the include looks like #include "cJSON.h", the extra one and the original one.

@Vader_mester: same here, it does compile directly from Eclipse but that takes a long time, sometimes several minutes in case there is only a single file change. As an alternative I use the simple "make -j8" command in the /mys32/mingw32 shell to build my applications.
The latter is much faster and more efficient. So: use Eclipse for editing and flashing, adding a superfluous but harmless extra include file here and there and use command line based make command to build.

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: Eclipse problem: can't resolve "Unresolved inclusion" for "cJSON.h" file

Postby Vader_Mester » Thu Jun 28, 2018 12:21 pm

Zingemneire wrote:Hi All,

I have been busy with other things the last week so i did not check the forum for answers for a while.

As to the original problem: I had an additional case of the same. in one of my c files i Had to put in this line.

Code: Select all

#include "esp_err.h"  // extra pointless include to allow Eclipse to resolve ESP_OK and ESP_FAIL
As the file builds perfectly file "esp_err.h" is definitely referenced in another include file somewhere so the compiler does find it but for some reason Eclipse can't find it in this file ( although it does find it in many other cases/files without extra include instructions ). In this particular case I have put in the extra include instruction and left it at that.

@Vader_mester: same here, it does compile directly from Eclipse but that takes a long time, sometimes several minutes in case there is only a single file change. As an alternative I use the simple "make -j8" command in the /mys32/mingw32 shell to build my applications.
The latter is much faster and more efficient. So: use Eclipse for editing and flashing, adding a superfluous but harmless extra include file here and there and use command line based make command to build.
I keep doing the same thing. Only problem is that it's sometimes hard to read error notes in mingw shell :D

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

Who is online

Users browsing this forum: No registered users and 122 guests