Eclipse IDE plugin says Errors exist but console says build complete

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Eclipse IDE plugin says Errors exist but console says build complete

Postby zliudr » Thu Jun 24, 2021 11:24 pm

This is the small dialog that asks you to proceed or cancel. Also, the bin file was generated. It's definitely the latest because I can change something and the bin file will have the change. I wonder if the dialog means anything real.
Last edited by zliudr on Fri Jun 25, 2021 3:09 am, edited 1 time in total.

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby BrianP » Fri Jun 25, 2021 2:34 am

Are you getting lots of "unresolved includes" or the result of "unresolved includes"? I get the same. There seems to be some sort of issue with Eclipse and the ESP Plugin and/or the Cmake file. Somehow the compiler knows what to compile but the Eclipse indexer does not. If you re-index you will notice there is no activity.

I have been trying to figure this out. I don't think it affects flashing (since the compiler knows what to do) but it will make debugging/use of Eclipse a major pain.

I found this https://www.eclipse.org/forums/index.php/t/1104894/ but I can't figure out what this solution https://www.eclipse.org/forums/index.ph ... sg_1831296 is saying.

This seems to be a common issue with current Eclipse versions and Cmake based systems. Alas I have not been able to solve it yet.

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby zliudr » Fri Jun 25, 2021 2:56 am

I'm not very familiar with Eclipse. Could you point to me how to re-index?
FYI, my program code is very long and has many files including custom library components I wrote. So I couldn't really take advantage of the IDE but use an external text editor most of the time because Eclipse don't know how to find my custom library components. Could a trivial issue for those experienced with Eclipse though.

Anyway, I made some superficial change on my code and compiled again, without upload, I got no errors and very few lines of printout, mostly the commands executed by the system and no "resolved" stuff. Do you mean linker somehow couldn't find the object to link to? I had that happen when I didn't define the global variables that I used. Those errors show up at the end of the log, easy to pick out.

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby BrianP » Fri Jun 25, 2021 3:04 am

To reindex, select the project and Menu Project -> C/C++ Index -> Rebuild.

Damn. I just did that and it worked. It reindexed my files.

One of the advantage of an IDE like Eclipse is that it indexes the source code so the internal text editor can do stuff like hover help, Open Declaration, and so on. Usually a lot of my code is custom as well. When it works Eclipse is great but it wants to be all things to all people so there are a near infinite number of options and settings. If you have a problem with c and Eclipse, most of the solutions you find will point you to Java or whatever. One great thing about Microchip Studio (based on Microsoft Studio) is that it has a very narrow set of options to you can solve IDE issue quickly.

I am not sure what you are saying about re-compiling. One thing I try sometimes is to "clean" and/or "rebuild" (Project -> Clean ... followed by Project -> Build All or ctrl-b).

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby BrianP » Fri Jun 25, 2021 3:15 pm

This is what I posted on the Eclipse Forum. TLDR If you change run/debug configuration the problem happens. You need to close/open Eclipse to fix it. I'll let you know if they approve my post and whether there are fixes or a work around.

I am using Eclipse CDT 03-2021 with the ESP-IDF Plugin. The plugin does not seem compatibly with 06-2021 but the described behaviour is the same. This seems to be a common problem.

The project may or may not load with unresolved includes on a fresh start. It will build with no errors but show errors in the editor, suggesting the indexer is not in synch with the source. Reindexing does not help.

This is a summary of the log files of a failing and working index

****Fails****
Project: SoftAP1
File: file:/C:/Users/bjpic/eclipse-windows/SoftAP1/main/softap_example_main.c
Language: GNU C
Index Version: 219.0
Build Configuration: Configuration
Context: file:/C:/Users/bjpic/eclipse-windows/SoftAP1/main/softap_example_main.c
C, {}
Versions in Index: 1
C: {}; 4 macros, 10 includes, 46 names;

Macro definitions (from language + headers in index):

****Works****
Project: SoftAP1
File: file:/C:/Users/bjpic/eclipse-windows/SoftAP1/main/softap_example_main.c
Language: GNU C
Index Version: 219.0
Build Configuration: Configuration
Context: file:/C:/Users/bjpic/eclipse-windows/SoftAP1/main/softap_example_main.c
C, {}
Versions in Index: 1
C: {}; 4 macros, 10 includes, 512 names;

Include Search Path (option -I):


*********************************************

Note that the working index has an Include Search Path (option -I). I cannot find where to set the Include Search Path option for the indexer. In prior projects when I had unresolved includes (i.e. compile failures) there was an option for "Include Paths" but that is no present in the project or window properties.

Working and non-working seem to depend upon the configuration selected. The default run configuration works but the default debug configuration does not work. If run works, switching to debug causes failure. Switching back to run does not fix the failure. Switching to run, closing Eclipse, re-opening Eclipse removes the failure. It seems that closing Eclipse then reopening it even with the debug configuration sometimes works. When the debug configuration works is also has the Include Search Path (option -I ) in the log.

If debug works and I change to run, I get the same problem. I have to switch configurations because of an unfixed bug in the OpenOCD-ESP

This is the contents of the project indexer preferences org.eclipse.cdt.core.prj-SoftAP1.prefs but I have tried numerous permutations thereof.

eclipse.preferences.version=1
indexer/indexAllFiles=false
indexer/indexAllHeaderVersions=false
indexer/indexAllVersionsSpecificHeaders=
indexer/indexOnOpen=true
indexer/indexUnusedHeadersWithAlternateLang=false
indexer/indexUnusedHeadersWithDefaultLang=false
indexer/indexerId=org.eclipse.cdt.core.fastIndexer
indexer/preferenceScope=0
indexer/skipFilesLargerThanMB=8
indexer/skipImplicitReferences=false
indexer/skipIncludedFilesLargerThanMB=16
indexer/skipMacroReferences=false
indexer/skipReferences=false
indexer/skipTypeReferences=false
indexer/useHeuristicIncludeResolution=false

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby zliudr » Fri Jun 25, 2021 8:20 pm

This is beyond my capabilities. I've not used sophisticated modern IDEs since turbo c++ if you know what that was. I looked at C/C++ indexing. Mine is greyed out so it's a different problem. Sometimes it goes away if I restart my IDE but this time it just won't go away. Too many things to learn and not enough time to learn them.

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby BrianP » Thu Jul 01, 2021 2:51 am

I raise an issue regarding the Eclipse unresolved includes issue https://github.com/espressif/idf-eclips ... issues/309

The fix is
"An immediate workaround could be - delete the "build" folder from the project and build an entire project again and that should resolve the errors."

That worked for me.

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby zliudr » Thu Jul 01, 2021 3:42 am

So you must delete the folder? build clean is not helping for sure. I’ll try tomorrow.

I didn't realize my work computer is still on and with the project open. So I went ahead and deleted the build folder (wow 213 MB?!).
I rebuilt it and still saw the error dialog despite build complete (0 errors) printed on my console.

I might just follow the instruction I received with a separate issue I reported on git to update to latest master to see if that solves the annoying problem.

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby BrianP » Thu Jul 01, 2021 12:36 pm

Darn. It must be a different issue. Perhaps you can raise an issue at the Eclipse Plugin github page?

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: Eclipse IDE plugin says Errors exist but console says build complete

Postby zliudr » Mon Jul 05, 2021 8:40 pm

I was just resting the past weekend and today I fired up Eclipse IDE. The build, launch, and stop buttons look slightly different with thick white boarder around these buttons. Did it update itself? Now the same project no longer reports the annoying error when compile has no error. It's all so opaque what was done, either Eclipse update or espressif plugin update.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 119 guests