Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT 8/Indigo: Editor erroneously marks some symbols as unresolved(Symbols get flagged even through they are defined and "open declaration" works)
CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #690450] Wed, 29 June 2011 14:39 Go to next message
Keath Milligan is currently offline Keath MilliganFriend
Messages: 38
Registered: July 2009
Member
When I open a C file, some symbols get flagged as "could not be resolved" even though they are defined in an include file and I can right click or F3 to open their declarations successfully.

It appears that this is happening because these particular symbols are defined in multiple places. For some reason CDT is not considering the header that is included by the C file and getting confused by the other definitions elsewhere in the project.

Anyone know of a work-around on this?
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #690961 is a reply to message #690450] Thu, 30 June 2011 13:23 Go to previous messageGo to next message
eight  is currently offline eight Friend
Messages: 27
Registered: June 2011
Junior Member
I noticed this too. Even after the successful build errors do not go away. Rebuilding index does nothing. I simply give up on the error indexer, and rely on a console output as my guide.

--8
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #690969 is a reply to message #690961] Thu, 30 June 2011 13:40 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
eight wrote on Thu, 30 June 2011 09:23
I noticed this too. Even after the successful build errors do not go away. Rebuilding index does nothing. I simply give up on the error indexer, and rely on a console output as my guide.

--8

That is true that code analysis in CDT Indigo is not perfect. What you can do is to filter out offending ones in Preferences. You can disable or customize the scope to exclude certain file patterns.

Andrew
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #691147 is a reply to message #690969] Thu, 30 June 2011 20:03 Go to previous messageGo to next message
eight  is currently offline eight Friend
Messages: 27
Registered: June 2011
Junior Member
HI Andrew,

I did try to switch off some of the indexers, however, there was no direct correspondence between the error description and the indexer description, therefore I wasn't sure which one to turn off, and did not want to turn the wrong one, assuming that it is better to have false negatives than having false positives.

--8
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #691228 is a reply to message #691147] Fri, 01 July 2011 02:10 Go to previous messageGo to next message
osfan6313 is currently offline osfan6313Friend
Messages: 1
Registered: July 2011
Junior Member
I had a similar problem - this is what the file would show once I opened it up:

index.php/fa/3201/0/

I fixed this by adding the proper includes path to the project settings, as they didn't exist before. It appears as though Eclipse has now gone and added in all of the proper include directories, because once I did that some new directories to search for includes popped up.

(Indigo clean install, 32-bit Linux)
  • Attachment: cdt_error.jpg
    (Size: 145.96KB, Downloaded 39742 times)
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #691458 is a reply to message #691147] Fri, 01 July 2011 13:49 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
eight wrote on Thu, 30 June 2011 16:03
HI Andrew,

I did try to switch off some of the indexers, however, there was no direct correspondence between the error description and the indexer description, therefore I wasn't sure which one to turn off, and did not want to turn the wrong one, assuming that it is better to have false negatives than having false positives.

--8

To be clear (as hordes of people read this), first you should make sure that all includes are resolved and there is no "unresolved inclusion" messages. If there are - you should add proper include paths in project properties->"C/C++ General"->"Paths and Symbols". I believe you've done that. If you still have bogus errors represented by "bug" icon, those are configurable on Window->Preferences->"C/C++"->"Code Analysis" page. The problem "Name" should match the error description you are seeing. Use "Customize Selected" button and "Scope" tab lets define "Exclusion patterns".

Andrew
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #691497 is a reply to message #691458] Fri, 01 July 2011 15:16 Go to previous messageGo to next message
eight  is currently offline eight Friend
Messages: 27
Registered: June 2011
Junior Member
OK, I found the correspondence between the problem description and the indexer description, and the Customize feature. I changed the level from "Error" to "Warning", since it is not clear why the indexer fails in this particular file, and I don't want to loose its messages in other places it might be working.

I saw the exclusion feature too, but that one seems to be useless: basically, it offers to annotate each and every file (maybe even using patterns) for each workspace -- doable, but not practical, given the number of files and liquidity of the workspace.

--8
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #691567 is a reply to message #691458] Fri, 01 July 2011 18:20 Go to previous messageGo to next message
Nobody Mising name is currently offline Nobody Mising nameFriend
Messages: 75
Registered: July 2010
Member
Andrew Gvozdev wrote on Fri, 01 July 2011 09:49
If you still have bogus errors represented by "bug" icon, those are configurable on Window->Preferences->"C/C++"->"Code Analysis" page. The problem "Name" should match the error description you are seeing. Use "Customize Selected" button and "Scope" tab lets define "Exclusion patterns".


It will be more convenient to configure such false error reporting just by clicking this icon on the left. It should propose to exclude this file from analysis for example.

But in general excluding the whole file is not so good, may be only some names with regexp patterns should be excluded if they are not resolved?
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #693446 is a reply to message #690450] Wed, 06 July 2011 13:42 Go to previous messageGo to next message
vlad  is currently offline vlad Friend
Messages: 1
Registered: July 2011
Junior Member
This error is too urgent for me. After the upgrade to version 8 began to appear such an error, although the build of the project goes well, ie it's not my mistake.
index.php/fa/3259/0/
  • Attachment: screen.png
    (Size: 151.74KB, Downloaded 39394 times)

[Updated on: Wed, 06 July 2011 13:44]

Report message to a moderator

Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #693711 is a reply to message #690450] Thu, 07 July 2011 04:09 Go to previous messageGo to next message
eight  is currently offline eight Friend
Messages: 27
Registered: June 2011
Junior Member
I found one explanation/scenario reproducible. Let's say there are two projects master and slave. By itself, slave can compile and build without error markers. However when it is build due to a reference by a master, some of the includes are not resolved, as far as the master, not slave, is concerned. In this context these non-resolved dependencies will be marked as errors in the slave project. The include traversal still works, however. This gives an impression to the developer that something is wrong with the IDE.

Rebuild the slave alone, and the error markers will be gone.

In other words, the error markers are context-dependent, while the inclusion traversal takes the best result of all available contexts. That's a theory.

My gut feeling is that the Eclipse CDT developers are not testing against this scenario.

Sometime, I notice that building the slave project triggers the build of the master, which masks the behaviour above (that is the errors still appear in the slave, even after it had been rebuilt).

--8

[Updated on: Thu, 07 July 2011 18:11]

Report message to a moderator

Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #693779 is a reply to message #693711] Thu, 07 July 2011 07:59 Go to previous messageGo to next message
uatek is currently offline uatekFriend
Messages: 1
Registered: July 2011
Junior Member
I had the same issue, in my case it wasn't enough with rebuilding, I rebuilt the whole workspace and the unresolved symbols where still there.

I finally tried deleting all the projects and recreating them with Indigo (my projects where first created with Helios or Ganimede), and that solved all the erroneous unresolved symbol marks.

[Updated on: Thu, 07 July 2011 08:04]

Report message to a moderator

Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #693847 is a reply to message #693779] Thu, 07 July 2011 10:30 Go to previous messageGo to next message
Nobody Mising name is currently offline Nobody Mising nameFriend
Messages: 75
Registered: July 2010
Member
CDT parser is still far away from perfect C++ compiler front end, so there will be false unresolved symbols. Compiler can recognize these symbols and CDT can't.

For example in a simple code from Boost Multi-Index library like these:

http://i51.tinypic.com/j6oev4.png

CDT fails to parse correctly, thouh compiler has no problems.

And the workaround proposed by CDT is to exclude the whole translation unit from analysis. It is also far from perfect solution.
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #694357 is a reply to message #690450] Fri, 08 July 2011 12:16 Go to previous messageGo to next message
Nikolai  is currently offline Nikolai Friend
Messages: 2
Registered: January 2011
Junior Member
I use CDT Indigo (version for Win32) and it marks lines like:
std::vector<int> aaa;

as unresolved. Any suggestions?
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #695202 is a reply to message #693847] Mon, 11 July 2011 09:20 Go to previous messageGo to next message
Alan Rouse is currently offline Alan RouseFriend
Messages: 14
Registered: July 2009
Junior Member
I have the same problem since I updated from Helios to Indigo. Every field reference in the project is flagged as Field Could Not Be Resolved, although the project builds and executes correctly. I tried all combinations of options in Windows\Preferences\C/C++\Indexer to no avail.

If I manually added the Include paths in Projects\Preferences\C/C++ General\Paths and Symbols then clicked OK the indexer would run and delete the entries I had just made!

I resolved the problem by unticking Enable Indexer in Windows\Preferences\C/C++\Indexer then again manually entering the Include paths in Projects\Preferences\C/C++ General\Paths.

This is not desireable. Something has obviously been lost in the upgrade from Helios to Indigo.
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #709666 is a reply to message #695202] Thu, 04 August 2011 06:51 Go to previous messageGo to next message
Stefan Mising name is currently offline Stefan Mising nameFriend
Messages: 7
Registered: June 2010
Location: Germany
Junior Member
Hello,
I have the same problem with Indigo in a larger qt-project and in nearly every file I have the unresolved symbols from standard libraries. The compilation works fine ... does anybody know how to solve this problem in a useful way?
Thank you very much for help
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #709802 is a reply to message #709666] Thu, 04 August 2011 10:19 Go to previous messageGo to next message
AK Mising name is currently offline AK Mising nameFriend
Messages: 10
Registered: August 2011
Junior Member
I reported bug #353719 for this issue.
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #892387 is a reply to message #690450] Thu, 28 June 2012 01:56 Go to previous messageGo to next message
Gustavo Ricarte is currently offline Gustavo RicarteFriend
Messages: 1
Registered: June 2012
Junior Member
I was having the same issue, until I find an easy way to solve it:
- Right-click on your project and choose Index -> Update with Modified Files
That should do the trick Wink
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #892477 is a reply to message #892387] Thu, 28 June 2012 11:47 Go to previous messageGo to next message
dario lime is currently offline dario limeFriend
Messages: 1
Registered: June 2012
Junior Member
Gustavo Ricarte wrote on Wed, 27 June 2012 21:56
I was having the same issue, until I find an easy way to solve it:
- Right-click on your project and choose Index -> Update with Modified Files
That should do the trick Wink


worked for me, thank you so much Smile
Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #1007202 is a reply to message #892477] Mon, 04 February 2013 22:59 Go to previous messageGo to next message
Boyd Parkinson is currently offline Boyd ParkinsonFriend
Messages: 1
Registered: February 2013
Junior Member
Much thanks. I couldn't get the cache cleaned out but this worked and the problem went away.
icon7.gif  Re: CDT 8/Indigo: Editor erroneously marks some symbols as unresolved [message #1722771 is a reply to message #892477] Tue, 09 February 2016 02:06 Go to previous message
Edward Januska is currently offline Edward JanuskaFriend
Messages: 1
Registered: February 2016
Junior Member
dario lime wrote on Thu, 28 June 2012 11:47
Gustavo Ricarte wrote on Wed, 27 June 2012 21:56
I was having the same issue, until I find an easy way to solve it:
- Right-click on your project and choose Index -> Update with Modified Files
That should do the trick Wink


worked for me, thank you so much Smile


Worked for me too (said the guy in the old thread)
Previous Topic:class nested Template + inner enum syntaxe
Next Topic:mismatch between lines in console and editor
Goto Forum:
  


Current Time: Tue Apr 23 15:46:19 GMT 2024

Powered by FUDForum. Page generated in 0.04890 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top