Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Symbol could not be resolved errors(Symbol could not be resolved errors)
Symbol could not be resolved errors [message #1137506] Mon, 14 October 2013 14:45 Go to next message
Mike Tarullo is currently offline Mike TarulloFriend
Messages: 14
Registered: April 2010
Junior Member
I recently installed Eclipse Kepler for C\C++ in CentOS 6.4 running in VMware Player 6.0.

After getting all of the above installed I ran yum groupinstall "Development Tools" in my CentOS Terminal. I checked for the C++ headers after this and they all were found in \usr\include\C++\4.4.4.

The first thing I did to try and get familiar with the new environment was to create a new Hello World project. Before I did this I configured a preferred toolchain by performing the following: Window -> Preferences -> C/C++ -> New C/C++ Project Wizard and setting the preferred toolchain to Linux GCC for each project type.

Then I created a new C++ project and noted that the toolchain was the Linux GCC toolchain.

As soon as the project was created I received three error in the Problems tab: Symbol 'cout' could not be resolved, Symbol 'endl' could not be resolved, Symbol 'std' could not be resolved. Oddly enough, even with these errors the project builds and executes (output displayed in Console tab)!!!

I suspected the problem might be with the include paths for the project so I did the following to see if it would resolve the errors: Project -> Preferences -> C/C++ General -> Paths and Symbols and added \usr\include and \usr\include\C++\4.4.4 to the ath list. This does not resolve the error.

Also my #include line for the iostream header is flagged with the message (warning?) unresolved inclusion.

Can anyone tell me what is going on? How do I configure a project so that include files, both the C++ and my own user developed headers, can be found by Eclipse?

Thanks,
Mike
Re: Symbol could not be resolved errors [message #1137559 is a reply to message #1137506] Mon, 14 October 2013 15:27 Go to previous messageGo to next message
Mike Tarullo is currently offline Mike TarulloFriend
Messages: 14
Registered: April 2010
Junior Member
Well after looking at similar post for this error on the forum I found a solution (or at least a workaround) for this problem.

I found a post that talked about the errors coming from the static code checker. So I started poking around the preferences to see if there was a way to set the location of the include paths for the static checker. I did not find any (but I'll keep looking) but I did find a way to turn of the error, permanently! In Window -> Preferences -> C\C++ -> Code Analysis just uncheck all the error checking!

Now I know that static checking is a "somewhat" nice feature. But when the complier is going to do this anyway we must ask ourselves is it really needed? Is it worthwhile giving up machine cycles for something that is going to be checked again anyway? Not only do unnecessary feature bloat our code, when we add a feature that does not work, like appears to be the case here, what service do we provide to our users?

While I was looking at the forum for similar post for this error, I noticed many posts where developers were frustrated with Eclipse. I have used it for years and it can be a love\hate relationship. When it works it's great, when it does not it's frustrating, but that is true for just about anything (including Congress!).

So my suggestion to the Eclipse contributors is don't bloat the software, especially if the feature does not work! And my suggestion to the complainers is be a little more professional in your posts. Offer suggestions or constructive opinions and leave the f---ing out of your posts. It short, grow up!

Mike
Re: Symbol could not be resolved errors [message #1140367 is a reply to message #1137559] Wed, 16 October 2013 09:58 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
There is a misunderstanding here.
1) The errors are indeed coming from the static code checker CODAN. But the reason is not a fault in CODAN. CODAN depends on the Eclipse indexer. It's a internal database that contains all symbols, functions, include files etc.. The indexer is used to make Content Assist work and guides you from the declaration to the definition of a symbol. If the indexer is not setup correctly then CODAN will certainly fail.
Usually Eclipse puts all header/source files in your project in the indexer. Then it will add the system headers with the help of the compiler (you must specify the correct toolchain for your project). Then it will scan the output of your compilation to see if there are some more include paths to look for. You can also add include paths, symbols manually if the indexer was not able to find them (e.g. for external libs that you are using).
Everything is configured in Project Properties->C/C++ General->Preprocesser Include Paths, Macros.

2) the static code checker does not the same as the compiler. Firstly, there are many checks that are missed by the compiler. Secondly, the static code checker is much faster (in comparison to a long compilation step) and sometimes can you suggest a solution (it is called Quick Fix in Eclipse).


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Symbol could not be resolved errors [message #1147216 is a reply to message #1140367] Sun, 20 October 2013 18:41 Go to previous message
Mike Tarullo is currently offline Mike TarulloFriend
Messages: 14
Registered: April 2010
Junior Member
Thank you Axel for your reply.

Can you be specific about what CODAN checks that the complier (gcc in this case) does not?

Also you mention that there is a great deal that CODAN checks that the complier does not. Can you quantify this?

Thanks,
Mike
Previous Topic:c graphic library
Next Topic:[Photran] Preprocessor Symbols
Goto Forum:
  


Current Time: Sat Apr 20 01:16:27 GMT 2024

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

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

Back to the top