Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » "could not be resolved" errors, but Go To Definition works!
"could not be resolved" errors, but Go To Definition works! [message #1764002] Tue, 23 May 2017 20:52 Go to next message
Andrew Voelkel is currently offline Andrew VoelkelFriend
Messages: 17
Registered: September 2016
Junior Member
I've created a makefile project from Nordic example code. Since this is a makefile project from a known source, I'm not getting build errors. I've also set up indexing properly AFAIK, having double checked many things (and see below).

But I'm getting errors in the Problems windows and red lines in the editor, stemming from numerous "could not be resolved" occurrences. The weird thing is when I click on one of the offending items (often just a simple #define constant), the IDE dutifully takes me to the definition. So one part of Eclipse understands what is going on and is resolving symbols, but another part of Eclipse does not. And none of this has anything to do with build errors, because the make based build runs with no errors.

How in tarnation do I figure out what is going on here?

- Andy
Re: "could not be resolved" errors, but Go To Definition works! [message #1764005 is a reply to message #1764002] Tue, 23 May 2017 20:59 Go to previous messageGo to next message
Andrew Voelkel is currently offline Andrew VoelkelFriend
Messages: 17
Registered: September 2016
Junior Member
I just discovered that the errors are all symbol resolutions errors of the code analyzer. This maybe explains why Go To Definition works - it isn't part of the code analyzer.

Is the code analyzer maybe just not that good?
Re: "could not be resolved" errors, but Go To Definition works! [message #1764770 is a reply to message #1764005] Fri, 02 June 2017 07:55 Go to previous messageGo to next message
David Saunders is currently offline David SaundersFriend
Messages: 5
Registered: June 2017
Junior Member
Hi Andy,

I have been using Eclipse for 2 days now, so be aware of my advice :+) I had the same problems, and eventually managed to figure them out.

Are you aware of setting the compiler options in 2 places?

Hopefully you have already set Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect to -std=c++14 or whatever.

To get the Indexer to work, one has to:

Select Window->Properties -> C/C++ General -> Preprocessor Include Paths, Marcos etc. -> Providers Tab
then select your compiler: CDT GCC Built-in Compiler Settings
In Command to get compiler options text box , put -std=c++1z or whatever at the end of what is there already, other compiler options can be added here too.

So all this enables the Indexer to correctly diagnose syntax problems and display them in the code window. In this case it should hopefully take away all the misdiagnosed problems.

Regards :+)
Re: "could not be resolved" errors, but Go To Definition works! [message #1784934 is a reply to message #1764770] Fri, 06 April 2018 05:13 Go to previous messageGo to next message
Emin Kulturel is currently offline Emin KulturelFriend
Messages: 1
Registered: April 2018
Junior Member
Thanks David,

It resolved my problem..
Re: "could not be resolved" errors, but Go To Definition works! [message #1804236 is a reply to message #1764002] Thu, 21 March 2019 03:52 Go to previous messageGo to next message
z xd is currently offline z xdFriend
Messages: 1
Registered: March 2019
Junior Member
I meet the same problem, and you can try to restart eclipse:
File->Restart
And the problem has disappeared, it is amazing.
Re: "could not be resolved" errors, but Go To Definition works! [message #1862385 is a reply to message #1764770] Thu, 30 November 2023 12:29 Go to previous messageGo to next message
Mark Bratcher is currently offline Mark BratcherFriend
Messages: 6
Registered: September 2021
Junior Member
I still have this problem with Eclipse 2023-09.
My Eclipse does not have the Preferences settings mentioned in the "solution" above.
Re: "could not be resolved" errors, but Go To Definition works! [message #1862560 is a reply to message #1862385] Tue, 12 December 2023 04:35 Go to previous messageGo to next message
Tulian Mayers is currently offline Tulian MayersFriend
Messages: 1
Registered: October 2023
Junior Member

Andy, your issue with "could not be resolved" errors despite a successful build and proper indexing seems odd. Try these steps:

Re-index the project.
Check include paths and Makefile targets.
Disable CDT indexer optimization.
Clean and rebuild the project.
Use the "Go to Definition" feature.
If these don't work, investigate specific errors or explore community resources.
Re: "could not be resolved" errors, but Go To Definition works! [message #1862562 is a reply to message #1862385] Tue, 12 December 2023 05:13 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Perhaps you're using an outdated release?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: "could not be resolved" errors, but Go To Definition works! [message #1862604 is a reply to message #1862560] Wed, 13 December 2023 18:44 Go to previous messageGo to next message
ldiciolla@gmail.com Diciolla is currently offline ldiciolla@gmail.com DiciollaFriend
Messages: 1
Registered: December 2023
Junior Member
Hi All,
I downloaded the example code for std::unordered_set. It compiles ok but still the indexing doesn't appear to work after following all your advices.
Attached is a screenshot of the code in Eclipse Version: 2023-09 (4.29.0) Build id: 20230907-1323
Is there a definitive solution to this issue?

Thanks a lot
Re: "could not be resolved" errors, but Go To Definition works! [message #1862855 is a reply to message #1862604] Wed, 03 January 2024 07:16 Go to previous messageGo to next message
stork Avery is currently offline stork AveryFriend
Messages: 1
Registered: January 2024
Junior Member
Exactly the same issue occurs to me, and you may want to try restarting Eclipse: doodle jump

[Updated on: Thu, 04 January 2024 08:56]

Report message to a moderator

Re: "could not be resolved" errors, but Go To Definition works! [message #1863100 is a reply to message #1862855] Tue, 16 January 2024 09:35 Go to previous messageGo to next message
Majaswi Emmar is currently offline Majaswi EmmarFriend
Messages: 2
Registered: November 2023
Junior Member
The problem stems from Eclipse not properly indexing the Makefile itself, which means it can't correctly resolve symbols that are defined in the Makefile.

To resolve this issue, you can try the following steps:
Rebuild the Index: Eclipse periodically rebuilds its index in the background. To force a rebuild, go to Project > Clean > Clean Project.
Incremental builds can help Eclipse keep the index up-to-date with changes made to the project. To enable incremental builds, go to Project > Properties > Build Automatically and check the Enable Incremental Build checkbox.
If the previous steps don't work, you can manually update the index for the Makefile file. Right-click on the Makefile file and select Refresh.
If none of the above steps work, you can try clearing the index and reindexing the project. To do this, go to Project > Clean > Clean Project and then select Clean index. This will remove the current index and force Eclipse to rebuild it from scratch.
After following these steps, the indexing issue should be resolved, and the "could not be resolved" errors should disappear.
Re: "could not be resolved" errors, but Go To Definition works! [message #1863495 is a reply to message #1862855] Tue, 06 February 2024 12:47 Go to previous message
Valentin Marmon is currently offline Valentin MarmonFriend
Messages: 2
Registered: December 2023
Junior Member
Go to Project > C/C++ Index > Rebuild. This will rebuild the index for your project, which might resolve the issues related to symbol resolution.
snaptik

[Updated on: Tue, 06 February 2024 12:48]

Report message to a moderator

Previous Topic:Please help me compile on Mac!!???
Next Topic:Launch Bar: No launch configuration is found for the given launch descriptor and target
Goto Forum:
  


Current Time: Thu Apr 25 01:37:12 GMT 2024

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

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

Back to the top